# Migrate Adaptiva SQL Database

This article provides an overview of the steps required to migrate the Adaptiva OneSite database to new hardware while keeping the Adaptiva server on the existing machine, thereby allowing you to reduce the load on the current server, improve performance, and centralize SQL management.

## Prerequisites

* Verify you have sysadmin permissons on the new SQL server to migrate the Adaptiva database to the new server.
* If your Adaptiva Server is integrated with ConfigMgr and the ConfigMgr database will be on a different SQL Server, you must ensure SPNs (Service Principle Name) are created and Kerberos delegations are set up. This will ensure communication between the Adaptiva SQL database and ConfigMgr SQL database.
  * For additional information please see [SPNs and delegation](/platform-install/additional-configuration/platform-spns-delegation.md)
* Download and install [SQL Server Management Studio](https://learn.microsoft.com/ssms/install/install).

## 1. Stop Adaptiva server services

*Perform the following on the origin Adaptiva Server.*

1. Open Windows Services and right-click on **AdaptivaServer** and select **Properties**.
2. Click the **Stop** button and select **Disabled** from the **Startup type** dropdown.
3. Click **OK**.
   * **Note**: Ensure there are no external systems that will change this setting. Scheduled Tasks, Service Monitoring utilities, etc. Temporarily disable those if they exist.

     ![](/files/xvbK4dYDI0CHV5t4CKKZ)

## 2. Backup the Adaptiva database

Follow these steps to back up your database via Server Management Studio (SSMS), [Create a Backup](https://learn.microsoft.com/en-us/sql/relational-databases/backup-restore/quickstart-backup-restore-database?view=sql-server-ver17\&tabs=ssms#create-a-backup)

## 3. Transfer database backup to new SQL server

1. Transfer the file to the new SQL Server (e.g., network share or file copy).
2. Confirm the file exists on the new SQL Server, is not corrupted, and is accessible locally.

## 4. Restore Adaptiva database on new SQL server

*Perform the following on the destination SQL Server*

Follow these steps to back up your database via Server Management Studio (SSMS), [Restore a database](https://learn.microsoft.com/en-us/sql/relational-databases/backup-restore/quickstart-backup-restore-database?view=sql-server-ver17\&tabs=ssms#restore-a-database).

## 5. Configure SQL server permissions

1. Update the following T-SQL script with the origin SQL Server `<DomainName>\<ComputerName>` and run it from SQL Management Studio:

   ```sql
   CREATE LOGIN [<DomainName>\<ComputerName>$] FROM WINDOWS;
   GO

   ALTER SERVER ROLE [sysadmin]
   ADD MEMBER [<DomainName>\<ComputerName>$];
   GO
   ```

* This will ensure that the permissions are retained after the database restoration.

## 6. Update Adaptiva database configuration

1. Open the Registry and navigate to `HKEY_LOCAL_MACHINE\SOFTWARE\Adaptiva\server\`.
2. Find `setup.adaptiva_db_option` and change the value to `3`.

   ![](/files/kES0LWGdOxW2gcqbCJYG)

This will update the **Specify Options For Creating The SQL Database** settings of the Adaptiva upgrade.

### OPTIONAL updates to database configuration

Configure the following settings if appropriate:

* If using a named SQL instance on a new SQL server machine, you must change the instance name on the `HKEY_LOCAL_MACHINE\SOFTWARE\Adaptiva\server\setup` `adaptiva_db_sql_named_instance` line in the registry.
* If using the default instance, you must leave the `HKEY_LOCAL_MACHINE\SOFTWARE\Adaptiva\server\setup`.`adaptiva_db_sql_named_instance` line blank in the registry.
* If not using the default SQL port 1433, you must set the port on the `HKEY_LOCAL_MACHINE\SOFTWARE\Adaptiva\server\setup` `adaptiva_db_port line in the registry`.
* If moving the database to a remote system not co-located with the Adaptiva Server service, the Adaptiva Server requires the `sysadmin` permissions to the new SQL server to change the database name in the registry.

## 7. Run Adaptiva server setup

1. Run `adaptiva-server-<version>-windows.exe` on the existing Adaptiva Server, and select **Advanced Upgrade**.

   ![](/files/dNvo67f9Q94KBfnFfma9)
2. Click **Next** until you reach the **Specify Options For Creating The SQL Database**.
3. Ensure **Create The Database In The Same SQL Instance As ConfigMgr Site Database** is selected.

   ![](/files/sv4BnwPzqxxPwVfqMsMl)
4. Click **Next** and at the Pre-requisites dialog click **Continue**.
5. On the Provide Information for the Database page, click to disable **Create the Database in the Site Database Server and Use Same SQL Login Settings**.
6. Under SQL Login, enter a **SQL Server Machine Name** of the FQDN of the destination SQL Server.
7. Leave **Use Adaptiva Server's Local System Account** checked.
8. Click **Next**. At the prompt, click **Yes** to confirm the account.
9. Click **OK**. Then click **OK** to confirm that the SQL Servers are linked.
10. Complete the install wizard and verify that the post install checks pass.

    ![](/files/QVhp1zGdynMUasom9ho3)

## 8. Validate migration

*Perform the following on the Adaptiva server.*

1. Ensure that the AdaptivaServer service is started.
2. Log in to the Adaptiva Admin Portal and ensure dashboards are visible.
3. Confirm clients are able to communicate with the server.
4. Monitor SQL activity to ensure the new database is being used.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.adaptiva.com/platform-install/migration/database-migration-new-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
