Migrate AAD Connect Database to New SQL Database

By | May 13, 2019

You might be wondering how to Migrate AAD Connect Database to New SQL Database, you might have searched Documentation from Microsoft but found none. I guess its not supported and what you need to do is install a new instance and run it in Staging Mode, I had tried this and it works really well but if this option is not good for you for some reasons then here is a non-supported guide on how to Migrate your AAD Connect Database to New SQL Database in few easy steps.

Stop and Disable “Microsoft Azure AD Sync” or AD Sync Service.

Open your Services.msc, locate Microsoft Azure AD Sync, right click on it then stop the service.


Migrate your old ADSync Database to new SQL server

First Back Up your database, then restore it on a new SQL Server Instance. Check the Collation, Service Account Name and Permissions, it should all be the same.

Export your Registry Settings

You can skip this if you trust me šŸ™‚
This is just a fail safe mechanism if things go wrong.

There are two configurations items to backup:


HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ADSync\Parameters
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOLCoExistence\CurrentVersion

Update Registry with new SQL Server Details.

Update ADSync Parameters Section, Server and SQL Instance if you use one otherwise leave it blank

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ADSync\Parameters\SQLInstance
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ADSync\Parameters\Server

Update MSOLCoExistence Section, Server and SQL Instance if you use one otherwise leave it blank


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOLCoExistence\CurrentVersion\SqlInstanceName
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOLCoExistence\CurrentVersion\SqlServerName

Enable and Start “Microsoft Azure AD Sync” or AD Sync Service.

Check Event Viewer for Logs

If you get Sync Errors like this, you might need a restart like what happened to me

After restart it when everything is set up correctly logs should show Finished


Recommended

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.