# Migrate Adaptiva Server

This article details the steps to move the Adaptiva application server from one Windows server to another. This article assumes Adaptiva server is installed to the **E:\program files\adaptiva\adaptivaserver**. It is recommended to keep the same installation location on the new server. For instance, You may want to migrate your server for the following reasons:

* You want to move your server to the cloud.
* Your current hardware no longer supports a newer version of Windows Server.
* Your current hardware does not have enough disk space.

## Prerequisites

{% hint style="info" %}
We recommend running the custom client workflow and the initial robocopy at least 4 weeks prior to migrating the server. The robocopy process primarily applies to the Adaptiva content library, as it typically makes up the largest portion of the server’s data.
{% endhint %}

Before migrating to a new server, ensure the following steps have been completed:

1. Setup a DNS alias (CNAME) to point to the existing server.
2. Perform an initial robocopy of the Adaptiva Server installation directory to the new server.
3. Assign Adaptiva Clients to DNS alias. This will update the server name and server location values in the registry for each client.

### Initial Robocopy

This is to pre-stage the Adaptiva Server files on the new server. This reduces downtime during the final migration.

1. Enter the following command into a termnial:

   ```shell
   robocopy "E:\Program Files\Adaptiva\AdaptivaServer" "\\<NewServer>\E$\Program Files\Adaptiva\AdaptivaServer" /MIR /Z /R:2 /W:5 /LOG:precopy.log
   ```
2. Ensure the destination path matches the source path exactly.

If the Adaptiva content library is stored outside of the default installation path, perform a separate robocopy for that directory as well.

### Assign Clients to DNS Alias

Prior to migrating the Adaptiva server, you will first want to move clients by updating the new server name and location registry values. To do this, you will run the `AssignAdaptivaClientToDNSAlias` workflow by following the steps below.

1. Download the [AssignAdaptivaClientToDNSAlias workflow](https://adaptiva.com/hubfs/Docs/Workflow_Assign%20Adapitva%20Client%20To%20DNS%20Alias.obex) using this link.
2. Import the workflow by selecting **settings gear > Import** from the OneSite Platform and select the workflow .obex file.

   ![](/files/wmtrn9AC9jefEfDVBTUZ)
3. (Optional) Create a [Group](https://docs.adaptiva.com/platform-guide/platform-features/assets/groups) of devices for this workflow to target.
   * You can also just target **All Clients** or use an existing Group.
4. From the OneSite Admin Portal, select **OneSite Anywhere**.

   * If you do not have OneSite Anywhere enter `/content-push` at the end of your server URL:

   `https://<servername>:[port]/content-push`
5. Select **Content Push** from the side navigation.

   ![](/files/VZ2AW4ab1WvcxowCJ7uk)

   * The content-push URL will already display the Content Push pane.
6. Click on **+New** to create a new Content Push Policy and enter the following:
   * **Name** - Assign Adaptiva Clients To DNS Alias.
   * **(Optional) Description** - Add a description.
   * **Target Groups** - Click **Browse**, select the group or collection and click **OK**.
   * **Intellistage and Push Settings** - Toggle OFF **Enable IntelliStage**.
7. Click on **Advanced Settings** at the bottom of the pane.

   ![](/files/dhv2g2QlbfRlFQVQXpsc)
8. Click **Browse** next to **Client Policy Execution Workflow**, find the Workflow named **Assign Adaptiva Client To DNS Alias** and select it.

   ![](/files/eCSiJEiCzwN8y4FbrC0o)
9. Click **OK**, **Close**, then **Save**.
10. Click the **More** dropdown and select **Run Policy**.

    ![](/files/L8kG48W4Nist9Rhs9dqL)

This will trigger the clients to begin pointing to the DNS alias. Depending on how many clients you have, this can take a few weeks to get all of your clients redirected.

## Migrate Adaptiva server application

1. On the existing Adaptiva server, [uninstall the Adaptiva **client**](/platform-install/client-install-and-uninstall/client-uninstall.md).
2. Stop and disable the **AdaptivaServer** service.
3. Perform a final robocopy of the Adaptiva Server installation directory.
   * This ensures the new server has the most up-to-date files before proceeding with the remaining migration steps.
   * Since robocopy copies only the latest data, this second run of the robocopy will take less time than the initial robocopy from the Prerequisites above.
   * If the Adaptiva content library is not in default location in the server install path, copy it to same path on new server.
4. Copy *C:\windows\system32\drivers\AdaptivaServerTransport.sys*\* to the new server to the same location.
5. Backup server and driver registry keys, and copy to **E:\temp** directory on new server

   ```shell
   reg.exe export HKLM\SOFTWARE\Adaptiva\server <BackupLocation>\AdaptivaServer.reg /y
   reg.exe export HKLM\SYSTEM\CurrentControlSet\services\AdaptiveProtocolServer <BackupLocation>\AdaptivaDriver.reg /y
   ```
6. Run this command to backup the Adaptiva server service information and copy to E:\temp directory on the new server

   ```shell
   wmic service where (Name = 'AdaptivaServer') get caption, Description, DisplayName, Name, PathName, ServiceType, StartName ><BackupLocation>\AdaptivaServiceInfo.txt
   ```

From the new server follow the steps below:

1. Import registry keys:

   ```shell
   reg.exe import E:\temp\AdaptivaServer.reg
   reg.exe import E:\temp\AdaptivaDriver.reg
   ```
2. Create the AdaptivaServer service:

   ```shell
   sc create AdaptivaServer type=own start=auto DisplayName=AdaptivaServer binPath= E:\Program Files\Adaptiva\AdaptivaServer\bin\AdaptivaServerService.exe
   ```

   * If the path contains space, it is necessary to surround the path in quotes.
3. Create the AdaptivaProtocol service:

   ```shell
   sc create AdaptiveProtocolServer binPath="%systemroot%\system32\drivers" type=kernel start=demand DisplayName=AdaptiveProtocolServer
   ```
4. If you are using Kerberos authentication, be sure the [SPN is set correctly](/platform-install/additional-configuration/platform-spns-delegation.md) for the new server.
5. Copy the server and client setup executables to new server E:\temp.
6. Run AdaptivaServerSetup.exe as Administrator from E:\temp.
   * If any path or account is different on the new server, review the Adaptiva server registry **HKLM\SOFTWARE\Adaptiva\server** to find the old path and update to the new path prior to running setup.
7. Select **Quick Upgrade**.

{% hint style="warning" %}
If the install options show **Quick Install** the registry keys have not been properly updated, please do not proceed with an install and contact our [Support Team](https://adaptiva.com/support) to troubleshoot.
{% endhint %}

During the upgrade, all paths will exist and credentials used on previous setups will be populated in the wizard, so you should just need to select **Next** and **OK** throughout the wizard with the one exception of updating the Adaptiva Server name if this has changed.

1. Verify the paths and credential values are correct on each page of wizard.
2. Ensure all permissions required for the accounts are set correctly if using service accounts, such that they are in the local administrator group on the server.

After the upgrade completes, be sure all validation checks pass, then install the Adaptiva client.

1. Update the DNS alias so the new server and clients can establish communication.

{% hint style="info" %}
If the Server/Central Office is now in Azure or AWS this office needs to be set as WiFi type due to broadcast networking traffic not being allowed.
{% endhint %}

For confirmation the Adaptiva server is processing correctly, run the following SQL query on the Configuration Manager (ConfigMgr) database:

```sql
SELECT * FROM Adaptiva_notifications ORDER BY triggertime
```

This is the table the Adaptiva Server uses to process from Configuration Manager (ConfigMgr). With the Adaptiva Server service stopped, the rows will backlog, until the new server is up and available to process them. For the first few minutes the rows returned may continue to go up, but after 10 minutes, if the rows don't clear or at least start going down

Once SQL notification table has processed through, you are ready to change DNS alias to the new server IP.


---

# 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/server-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.
