With the installation of AADSync, a default instance of SQL Server 2014 Express is installed on the local server to host the ADSync database. This is installed on a separate SQL 2014 Express instance called ADSync. In some cases, it is required to move / migrate the database to a new server.

Since the underlying engine is still the traditional Sync engine, this process is fairly simple to achieve.

Database Migration Process

The high-level process looks as follows:
  • Backup of the database from the localDB
    • Azure AD Sync utilizes the SQL 2014 Express engine to store the database. It also creates a separate instance of SQL just for that purpose. The instance can be found at (localDB)\.\ADSync
    • Make sure you connect with the same accounts that installed the service in order to get to the database.
  • Restore the ADSync database to your selected SQL Server
    • In order to access the ADSync database make sure you give the account that runs the “Microsoft Azure AD Sync Service” the db_owner role mapping. In my case this was the user <domain>\AAD_42dbe4a2a688
  • Create a SQL Alias for the SQL server using CLICONFG.exe (Optional but recommended for easy database portability in future)
  • Stop the "Microsoft Azure Sync Service" service
  • Update the ADSync registry location of the ADSync database to reflect the new SQL location
    • The parameters for the SQL Server and the SQL Instance is located at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ADSync\Parameters
  • Start the "Microsoft Azure Sync Service" service
  • Test deployment by opening "Synchronization Manager"