Moving Databases & Log Files
Posted by Jaap Wesselius in Exchange, Exchange 2007, Tutorials on 18-01-2010
Tags: databases, Exchange, Exchange 2007, log files, moving, tutorial
One of the questions I get on a regular basis is how to move the database file and the log files to a different location.
First of all, it is a best practice to change the database and log files location. By default they are configured to use c:\program files\microsoft\exchange server\mailbox\first storage group (in Exchange Server 2007). Change this to a separate physical disk, and if possible two separate physical disks, one for the database file and one for the log files. If one of these two disks fails you have a much better recovery scenario then when the database and the log files are located on one physical disk. Also from a performance point of view it’s better to use two separate physical disks.
In this example I have an Exchange Server 2007 server that has three disks. One is the boot- and system partition, the other disks are for the database files (drive f:\) and the last disk is for the log files (drive g:\). The server is a default server, which means we have one Storage Group for the Mailbox Database and one Storage Group for the Public Folder Database.
On drive F:\ we’ll be placing the first Mailbox Database and the Public Folder database, on drive G:\ we’ll be placing the log files for Storage Groups.
Logon to the Exchange 2007 server and open the Exchange Management Console. In the navigation pane expand the Server Configuration and click the Mailbox option. In the Results Pane you’ll see the Mailbox Server with the First Storage Group and the Second Storage Group.
Right click the Mailbox Database and select “Move Database Path….”. In the Move Database Path wizard use the Browse button to select the new location of the database file, i.e. “F:\SG1\Mailbox Database.edb”. Repeat the same steps for the Public Folder Database and select “F:\SG2\Public Folder Database.edb” as the new location.
Please note that the database will be dismounted during the actual move operation and thus will be unavailable for users.
To move the log files of a Storage Group to a new location right click the Storage Group and select “Move Storage Group Path…”.
In this example I have an Exchange Server 2007 server that has three disks. One is the boot- and system partition, the other disks are for the database files (drive f:\) and the last disk is for the log files (drive g:\). The server is a default server, which means we have one Storage Group for the Mailbox Database and one Storage Group for the Public Folder Database.
On drive F:\ we’ll be placing the first Mailbox Database and the Public Folder database, on drive G:\ we’ll be placing the log files for Storage Groups.
Logon to the Exchange 2007 server and open the Exchange Management Console. In the navigation pane expand the Server Configuration and click the Mailbox option. In the Results Pane you’ll see the Mailbox Server with the First Storage Group and the Second Storage Group.
—- img
Use the Browse button for both the Log Files Path as well as the System Files Path to select the proper location, i.e. G:\SG1. Repeat the same steps for the Second Storage Group, and configure this to use G:\SG2.
As with moving the Database files the Databases will be dismounted when moving the log files to a new location.
It is also possible to use the Exchange Management Shell to move the Database files and the Log Files to another location. To move the Database Files from the default location to F:\SG1 use to following command:
Move-DatabasePath –Identity “First Storage Group\Mailbox Database”
–EdbFilePath “F:\SG1\Mailbox Database.edb”
To move the log files for the First Storage Group from their default location to G:\SG1 use the following command:
Move-StorageGroupPath –Identity “First Storage Group” –LogFolderPath G:\SG1
–SystemFolderPath G:\SG1
Repeat these step for the second Storage Group and the Public Folder Database but configure these to use F:\SG2 and G:\SG2
