Need to move Exchange database and/or log files to a new location? Below are a few simple commands (and some references) to make it happen.
NOTE: Moving an Exchange database and log files must be performed from the Exchange Management Shell (EMS). These steps currently cannot be performed from the Exchange Admin Center (EAC).
First, let’s get some specific information about the databases that might already existing in the environment to help us with moving. Running this command will tell us where a specific database and log is located to prepare us for a move.
Get-MailboxDatabase -Identity <DatabaseName> | FL Name, ServerName, EdbFilePath, LogFolderPath
This command will provide the same information as the previous command but will display info about all of the databases in our organization…
Get-MailboxDatabase | FL Name, ServerName, EdbFilePath, LogFolderPath
NOTE: Moving the database(s) and/or log files will require the mailbox database to be temporarily dismounted. All mailbox users will lose connectivity during this time.
Move-DatabasePath “Mailbox Database X” –EdbFilePath “X:\Exchange Databases\Mailbox Database X\Mailbox Database X.edb”
Move-DatabasePath “Mailbox Database X” –LogFolderPath “X:\Exchange Logs\Mailbox Database X\”
Move Database and Logs
Move-DatabasePath “Mailbox Database X” –EdbFilePath “X:\Exchange Databases\Mailbox Database X\Mailbox Database X.edb” –LogFolderPath “X:\Exchange Logs\Mailbox Database X\”
NOTE: After moving a database and/or log files the source folder and subfolders remain. It will be safe to delete these folders after the databases and log files have successfully been moved.