# SetQVPRAPISettings Method

## Overloads

| [SetQVPRAPISettings(QVPRAPISettings, Boolean)](https://help.qlik.com/en-US/qlikview-developer/May2024/Subsystems/QMSAPIref/Content/PIX.Services.V12.Api3.IQMS3.SetQVPRAPISettings.htm#PIX_Services_V12_Api3_IQMS3_SetQVPRAPISettings_PIX_QMSAPI_DataObjects_QVPRAPISettings_System_Boolean_) |  | Sets QVPR settings. |
| --- | --- | --- |

[](https://help.qlik.com/en-US/qlikview-developer/Subsystems/QMSAPIref/Content/PIX.Services.V12.Api3.IQMS3.SetQVPRAPISettings.htm) [](https://help.qlik.com/en-US/qlikview-developer/Subsystems/QMSAPIref/Content/PIX.Services.V12.Api3.IQMS3.SetQVPRAPISettings.htm)

## SetQVPRAPISettings(QVPRAPISettings, Boolean)

Sets QVPR settings.

### Declaration

```

          string SetQVPRAPISettings(QVPRAPISettings qvprSettings, bool doMigrate)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [QVPRAPISettings](https://help.qlik.com/en-US/qlikview-developer/May2024/Subsystems/QMSAPIref/Content/PIX.QMSAPI.DataObjects.QVPRAPISettings.htm) | qvprSettings | QVPRAPISettings that should be saved. |
| System.Boolean | doMigrate | Boolean value indicating if the migration of the QVPR data should be done. If set to false, the saved database will be empty. |

### Returns

| Type | Description |
| --- | --- |
| System.String | Empty string if the settings are successfully set, otherwise an error message |

### Remarks

##### security

Requires membership of local groups *QlikView Management API* and *QlikView Administrator*.

### Examples

The following code example uses the QMS API to retrieve QVPR XML settings. It changes the QVPR backup path and then saves the QVPR settings. If everything goes well, it prints the original backup path and then a message when it's done. If anything goes wrong, it prints an error message.

The service key injection is assumed to be handled behind the scenes. For an example of how to inject the service key, see Samples.

```
using System;
using System.Collections.Generic;
using QMSAPI;

class Program
{
    static void Main(string[] args)
    {
        try
        {
            // create a QMS API client
            IQMS2 apiClient = new QMS2Client();

            //retrieve a time limited service key
            ServiceKeyClientMessageInspector.ServiceKey = apiClient.GetTimeLimitedServiceKey();

            // get QVPR settings
            QVPRAPISettings settings = apiClient.GetQVPRAPISettings();
            if (settings != null)
            {
                // retrieve and print current backup path
                Console.WriteLine("XML backup path before change: " + settings.XmlBackupPath);
                // change XML backup path
                settings.XMLBackupPath = @"\\myfolder\backup";
                // save settings
                apiClient.SetQVPRAPISettings(settings, true);
                Console.WriteLine("Settings saved. XML backup path changed.");
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine("An exception occurred: " + ex.Message);
        }
        // wait for user to press any key
        Console.ReadKey();
    }
}
```

### See Also

[QVPRAPISettings](https://help.qlik.com/en-US/qlikview-developer/May2024/Subsystems/QMSAPIref/Content/PIX.QMSAPI.DataObjects.QVPRAPISettings.htm)

[GetQVPRAPISettings()](https://help.qlik.com/en-US/qlikview-developer/May2024/Subsystems/QMSAPIref/Content/PIX.Services.V12.Api3.IQMS3.GetQVPRAPISettings.htm#PIX_Services_V12_Api3_IQMS3_GetQVPRAPISettings)