A new Exchange Server 2007 Mailbox server installation is configured with one storage group and mailbox database by default. Depending on your environment and selections made during the server install it may also have a public folder database configured.

The default folder paths for the storage group and mailbox database are the within the installation folder for Exchange Server 2007, which is C:Program FilesMicrosoftExchange Server by default.

[PS] C:\>Get-StorageGroup -server br-ex2007-mb | fl name,logfolderpath,systemfolderpath

Name             : First Storage Group
LogFolderPath    : C:Program FilesMicrosoftExchange ServerMailboxFirst Storage Group
SystemFolderPath : C:Program FilesMicrosoftExchange ServerMailboxFirst Storage Group
[PS] C:\>Get-MailboxDatabase -server br-ex2007-mb | fl name,edbfilepath

Name        : Mailbox Database
EdbFilePath : C:Program FilesMicrosoftExchange ServerMailboxFirst Storage GroupMailbox Database.edb

The best practice in any environment is to configure the mailbox database and transaction log files on different disks, so that a failure of one disk allows database recovery using the remaining disk. This means that the default storage group and mailbox database should be moved after an Exchange 2007 Mailbox server is first installed.

This procedure involves an outage because the database gets dismounted when file paths are changed, so please keep that in mind when you are planning to do the work.

Changing an Exchange Server 2007 Storage Group Path

To move the storage group paths first, use the Move-StorageGroupPath cmdlet. Launch the Exchange Management Shell and run the following command, substituting the correct folder paths for your server.

[PS] C:\>Move-StorageGroupPath -Identity "First Storage Group" -SystemFolderPath E:SG1 -LogFolderPath E:SG1

You will be prompted to confirm the change.

Confirm
Are you sure you want to perform this action?
Moving path of storage group "br-ex2007-mb.exchangeserverpro.netFirst Storage
Group".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "Y"):y

Confirm
To perform the move operation, all the databases in storage group
"br-ex2007-mb.exchangeserverpro.netFirst Storage Group" must be temporarily
dismounted, which will make them inaccessible to any user. Do you want to
continue?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "Y"):y

After the command has completed you can see the new settings have been configured for the storage group, and the existing transaction log files were automatically moved to the new location as well.

[PS] C:\>Get-StorageGroup -server br-ex2007-mb | fl name,logfolderpath,systemfolderpath

Name             : First Storage Group
LogFolderPath    : E:SG1
SystemFolderPath : E:SG1

How to Move Storage Group and Database File Paths in Exchange Server 2007

Changing an Exchange Server 2007 Mailbox Database Path

To move the mailbox database path use the Move-DatabasePath cmdlet. In the Exchange Management Shell run the following command substituting the correct folder paths for your server.

Move-DatabasePath -Identity "Mailbox Database" -EdbFilePath "F:DB1Mailbox Database.edb"

You will be prompted to confirm the change due to the outage involved with dismounting the database to move it.

Confirm
Are you sure you want to perform this action?
Moving database path "br-ex2007-mb.exchangeserverpro.netMailbox Database".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "Y"):y

Confirm
To perform the move operation, the database
"br-ex2007-mb.exchangeserverpro.netMailbox Database" must be temporarily
dismounted which will make it inaccessible to all users. Do you want to
continue?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "Y"):y

After the move is complete you can see that the path settings for the mailbox database have changed, and the file moved to the new location.

[PS] C:\>Get-MailboxDatabase -server br-ex2007-mb | fl name,edbfilepath

Name        : Mailbox Database
EdbFilePath : F:DB1Mailbox Database.edb

How to Move Storage Group and Database File Paths in Exchange Server 2007

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for Practical365.com.

Comments

  1. Jorge Gaitan

    also, once the MOVE is completed, should I expect for the old db files to be deleted? or that something I need to do manually?

    1. Paul Cunningham

      Removing the original database is something you’ll need to do. Exchange will never automatically remove a database for you. It doesn’t even delete the files from disk when you remove the database, you’ve got to do that manually as well.

      1. Jorge Gaitan

        interesting. thank you very much.
        I had moved journaling to another drive but I noticed today the old Journaling db still being accessed.
        asides from changing the path on the db properties (from the exchange console, I selected journaling and did “change database path”)

        1. Jorge Gaitan

          I just checked and the command completed.
          We had a tech clean up from exchange accounts/inboxes that werent being used anymore last week to help the process today.
          the original db folder is showing 351GB, and the new 182GB …..
          should I be concern that the command didnt copy it all?

          1. Paul Cunningham

            Databases can have empty space in them, especially after you’ve removed a lot of data or mailboxes from the database. It is not unusual for a new database to turn out to be smaller when you move a bunch of mailboxes to it.

  2. Jorge Gaitan

    thanks for the commands!
    I strarted the move from E to F drives. I am using the following command.

    et-mailbox –database “%sourceDB%” | move-mailbox –targetdatabase “%DB%”
    This would ensure that all mailbox from the source database are moved to the target. This process is not quick however as it opens each mailbox and creates another at the target then moves messages and folders across to the target. If you specify more than one user (or like above feed the move-mailbox mailboxes as multiple variables) then exchange will move 4 mailboxes at a time. During the move the mailboxes being copied will not be available whilst they are transferred.

    I noticed though that E drive is getting full as it moves the mailboxes. I do see a the F drive filling up.

    why is that? how can I help my E drive (original db path) to not fill up like that?

    thanks for your time!

    1. Paul Cunningham

      Mailbox moves generate a lot of transaction logging.

      The solution is to move the mailboxes in batches that are small enough to not use up all available log drive space. After each batch run a full database backup to truncate the logs.

      1. Jorge Gaitan

        Got it! awesome Paul! thanks for the tip!
        I checked and most maiboxes have moved already and we still have 90GB available.
        what a relief!

Leave a Reply