To move Exchnage database file and transaction logs files to another location, use the Move-DatabasePath cmdlet in EMS.
|To view current list of databases||
|To view the location of any database||
Before you proceed with the move action please be aware that:
- The command must be run while logged on to the mailbox server hosting the database.
- This process requires that the database be dismounted while the move takes place, making it unavailable for mailbox users.
- This process should not be followed for databases that are replicated within a Database Availability Group.
- This process cannot be run at the same time as a backup is in progress.
- Also consider that for non-replicated databases the best practice is still to separate the database file and transaction logs onto separate disks.
To move an Exchange 2013 database named “Mailbox Database 1” to a new EDB file location of “E:\Exchange Server\Databases” and a new logs folder of “D:\Exchange Server\DatabaseLogs” the following command is used.
Move-DatabasePath “Mailbox Database 1” -EdbFilePath “E:\Exchange Server\Databases\Mailbox Database 1.edb” -LogFolderPath “D:\Exchange Server\DatabaseLogs”
To check whether the database is mounted and accessible again you can run the following commands.
Get-MailboxDatabase -Status “Mailbox Database 1” | Select Name,Mounted