Azure AD Connect – Migrate back to SQL Express (LocalDB)

Reading Time: 2 minutes

For larger enterprises it is recommended to host the database for the Azure AD Connect on a dedicated SQL server. According to the Microsoft docs it is possible to use the simplified LocalDB deployment for up to 100.000 objects in an Active Directory. If you are having more objects in your forest it is recommended to switch to a full SQL instance without the 10GB SQL Express file limitation.

There is a Microsoft article available which is describing the migration process from LocalDB to a remote SQL server. But what about the other way around? I could not find any information from Microsoft how to go back to a LocalDB deployment when migration the Azure AD Connect to a new server. What kind of options do we have?

Of course it would be possible to select the LocalDB option when doing a fresh installation of the Azure AD Connect service, but the idea was to export the current configuration without loosing any settings or synchronization rules when doing the migration. When doing the export of the current configuration you will end up with a “Exported-SynchronizationPolicy-date.json” file under the following path: %ProgramData%\AADConnect.

After examination the configuration block “deploymentMetaData” with the current matching SQL configuration counter part, I thought well maybe it is possible to switch this with the parameters from a LocalDB deployment? I compared the needed parameters and values from a LocalDB installation and modified the exported .json file from SqlServer to SqlExpress.

After installing the Azure AD Connect on the new infrastructure system please make sure to NOT use the Express Settings and choose “Customize” Settings instead. In the required components wizard part, specify the modified json file and procced with the installation.

To double check if the configuration change from the remote SQL database to SQL Express is working, check the following path if the local database files have been created: %ProgramFiles%\Microsoft Azure AD Sync\Data

Disclaimer: I am not sure if this is a supported way of Microsoft doing the migration to LocalDB. From a technical viewpoint I do not see any issues with this procedure. Hope this helps some people out there do simplify their Azure AD Connect deployments and destroy not needed dependencies specially for small and medium sized business.

Leave a Reply

Your email address will not be published. Required fields are marked *