Reading Time: 3 minutes
Share:
Twitter
LinkedIn
Facebook
Reddit
Whatsapp
Follow by Email

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!
[/themify_box]

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.

snip-0011479307217

Once mmc loads, right click on Active Directory Domain Services and click stop.

snip-0011479307476

When asked if it’s okay to stop associated services, click Yes to continue.

snip-0011479307541

Moving the Active Directory database and Log Files.

Right click on start button and click on Command Prompt (Admin).

snip-0011479307618

Once command prompt is visible, type ntdsutil and press enter.

snip-0011479307692

Next type activate instance ntds and press enter.

Then type files and press enter.

snip-0011479307761

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
[/themify_box]

snip-0011479307954

Once the database files are successfully moved, type the following command to move the logs: move logs to “E:\NTDS Logs”.

snip-0011479308087

Type Quit to close NTDSUtil file maintenance.

Type Quit agan to close NTDSUtil.

snip-0011479308327

Once the move has successfully completed, Return to the initially used services.mmc and start Active Directory Domain Services service.

snip-0011479308487

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.
[/themify_box]
Share:
Twitter
LinkedIn
Facebook
Reddit
Whatsapp
Follow by Email

Pixel Robots.

I’m Richard Hooper aka Pixel Robots. I started this blog in 2016 for a couple reasons. The first reason was basically just a place for me to store my step by step guides, troubleshooting guides and just plain ideas about being a sysadmin. The second reason was to share what I have learned and found out with other people like me. Hopefully, you can find something useful on the site.

0 Comments

Leave a Reply

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

*

I agree