Sometimes, as a sysadmin you may need to move the Active Directory database and / or log files from one location to another. This may be due to your Domain Controller running out of space. The location you choose to move the files to may be a different folder or a different drive all together. Unfortunately we are not able to use a simple copy and paste to do this.
This kind of action is not supported when the Active Directory Domain Services service is running!
In this guide we are going to be using a tool called ntdsutil. Ntdsutil is a command line tool which allows us to do a lot with Active Directory. For this guide we are going to use a very small part of what this tool can do.
[themify_box style=”yellow warning”] Important! When you are moving Active Directory database and log files. The specified location must exists! You cannot move the database or log files to non-existing drives or folders!
In this Step By Step, the Domain Controller I am using currently stores its AD database files in default E:\NTDS\folder and its log files in D:\NTDS Logs. For the purpose of this guide I am just going to swap the location of the two folders.
Stopping Active Directory Domain Services Service.
Log in to the primary domain controller as domain or enterprise administrator.
In Server Manager, navigate to Tools > Services.
Once mmc loads, right click on Active Directory Domain Services and click stop.
When asked if it’s okay to stop associated services, click Yes to continue.
Moving the Active Directory database and Log Files.
Right click on start button and click on Command Prompt (Admin).
Once command prompt is visible, type ntdsutil and press enter.
Next type activate instance ntds and press enter.
Then type files and press enter.
In files maintenance the command to move the db is required. As mentioned earlier, the need to move the database to D:\NTDS. Type the following command to enable the move: move db to D:\NTDS.
[themify_box style=”red note”] Note: Remember to use quotations (“”) should the path contain a space
Once the database files are successfully moved, type the following command to move the logs: move logs to “E:\NTDS Logs”.
Type Quit to close NTDSUtil file maintenance.
Type Quit agan to close NTDSUtil.
Once the move has successfully completed, Return to the initially used services.mmc and start Active Directory Domain Services service.
You will now need to remove the folders from their original folders.[themify_box style=”black note”] Note: This does not move the sysvol folder. To move the sysvol folder use this guide from Microsoft.