This weekend I was running through a migration from Server 2008 Hyper-V host to ESXi and Server 2012 as the primary DC in a test environment. All the VMs were backed up and converted to VMDKs beforehand, and the install went off without a hitch.
What I had done with the server, was to install 2012, and connect it to the domain (as a VM) and set it up as a secondary DC to replicate my AD over. Unfortunately, I had forgotten to demote the host DC before taking it offline, and was left with a problem. All the roles were on the root DC.
Because of that, I had to go in and seize the roles from the primary DC before I could use any administrative tools on the 2012 server. Ideally you want to demote the primary DC first so it transfers all the roles to the other DC. In this case, I had to do something a little more long winded.
- First, open an administrative command prompt and enter the ntdsutil tool
- Type roles, then press enter
- Type connections. Press enter
- Enter connect to server and then the server name. This is the server you want to transfer the roles to
- Enter Q to go back to the previous menu (the Roles menu)
- Now you need to seize the roles from the primary DC. These are: pdc, rid master, schema master, infrastructure master
There’s a handy script that’ll clear all the leftover metadata once you’ve done all of the above (it’s a lot easier than doing it all manually). It’s on a Technet in the script center – Metadata removal script. Copy the text out, and paste it into a notepad file. Save it as a .vbs file, then double click to run. It’ll scan the DCs in the domain and ask you which server it should remove metadata for.
Now, you’ll be able to delete the server from Active Directory Sites & Services. Tip: delete the NTDS Settings first, then remove the server.