How to migrate AAD Connect database to a new SQL server

 

1/ Stop + disable „Microsoft Azure AD Sync“ (ADSync)

2/ Migrate database to new SQL server (CI collation etc, see https://docs.microsoft.com/en-us/azure/active-directory/connect/active-directory-aadconnect-prerequisites)

3/ Restore db owner + permissions for a service account on new SQL server

4/ Backup registry:

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

5/ Update registry with new SQL server/instance name

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ADSync\Parameters\SQLInstance
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ADSync\Parameters\Server
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOLCoExistence\CurrentVersion\SqlInstanceName
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOLCoExistence\CurrentVersion\SqlServerName

6/ Start „Microsoft Azure AD Sync“ (ADSync)

7/ Check logs + sync manager console

8/ 🙂

Zjištění volného místa v lokální databázi AADConnect serveru

Tohle jsem nenašel nikde popsáno, takže poznačit:
1/ Zjistíme název instance z registru "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Local DB\Shared Instances\ADSync\InstanceName"   
    -- > (např. "LOCALDB#SHF818A2") 

2/ CMD.EXE 

C:\>cd C:\Program Files\Microsoft SQL Server\110\Tools\Binn 

C:\Program Files\Microsoft SQL Server\110\Tools\Binn>sqlcmd -S "np:\\.\pipe\LOCALDB#SHF818A2\tsql\query" 

1> select * from sysdatabases 

2> go  

…..blablabla  
ADSync        100 C:\Program Files\Microsoft Azure AD Sync\Data\ADSync.mdf
 ….blablabla

1> use adsync 

2> go 

Changed database context to 'ADSync'. 

1> sp_spaceused 

2> go 

database_name  database_size      unallocated space 
------------------ ------------------ ------------------ ------------------ 
ADSync                     8973.75 MB         404.98 MB 
reserved           data               index_size         unused
 ------------------ ------------------ ------------------ ------------------ 
8609744 KB         7487144 KB         1094992 KB         27608 KB 

1>exit
Zbývá zhruba 1,4 GB místa do limitu 10 GB, takže je nejvyšší čas přesunout databázi na plnohodnotný SQL server.
Aktualizace:
Novější verze AAD Connectu již obsahují cmdlet „Get-ADSyncDatabaseConfiguration“:
PS C:\> Get-ADSyncDatabaseConfiguration

IsLocalDBInstalled    : True
LocalDBUsedSpaceInMb  : 69.69
SqlServerName         : (localdb)
SqlServerInstanceName : .\ADSync
SqlServerDBName       : ADSync

PS C:\>

Používáme cookies. Další informace

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close