How to Move Storage Groups and Databases in an Exchange 2007 CCR Cluster

Exchange Server 2007 makes it fairly easy to move storage group and database paths using a few simple commands. Except if you’re running an Exchange 2007 CCR cluster.

For CCR clusters the technique used for standalone Exchange 2007 mailbox servers has to be modified slightly to account for the fact that the CCR cluster can’t move the transaction logs and mailbox database files itself. Instead the administrator must move the files manually, and issue commands to update the storage group and database configurations to the new paths.

So if the process is different (some would say it is harder) why not take another approach?

For example, why not just delete the storage group and database you don’t want, and create new ones in the correct paths? This might be feasible for the default storage group and database created when the cluster was first installed, but once you have added mailboxes it is no longer an option.

In that case, why not just create the new storage group and database and migrate the mailboxes instead? That might work fine in some cases (certainly that’s how I’ve done it sometimes in the past), but if there is a lot of mailboxes you can run into problems managing the amount of transaction logging that the mailbox moves create. It can also take a lot longer than simply moving the storage group and database.

Preparing to Move a Storage Group in an Exchange 2007 CCR Cluster

Before you move a storage group in an CCR cluster I recommend that you first back up the database in that storage group. By running a full backup you:

  • Truncate the transaction logs, which reduces the amount of data that needs to be moved
  • Give yourself a very recent back up to restore from if something goes wrong

Next check the copy and replay queues to make sure they are up to date.

[PS] C:\>Get-StorageGroupCopyStatus

Name                      SummaryCopySt CopyQueueLeng ReplayQueueL
                          atus          th            ength
----                      ------------- ------------- ------------
First Storage Group       Healthy       0             0

You should also make sure the new storage paths are properly configured and ready to be used in production.

Moving a Storage Group and Mailbox Database in an Exchange 2007 CCR Cluster

The first step is to suspend replication for the storage group.

[PS] C:\>Suspend-StorageGroupCopy "First Storage Group"

Confirm
Are you sure you want to perform this action?
Suspending Storage Group Copy "First Storage Group".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help

Next, dismount the mailbox database.

[PS] C:\>Dismount-Database "First Storage Group\Mailbox Database"

Confirm
Are you sure you want to perform this action?
Dismounting database "First Storage Group\Mailbox Database".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "Y"):y

With replication suspended and the database dismounted you can now move the files by simply copying them in Windows Explorer to the new locations. You must do this step on both cluster nodes, and make sure that the path matches on both nodes.

After copying the files the next step is to update the configuration of the storage group with the new folder path. Note the use of the -ConfigurationOnly switch on this command.

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

Confirm
Are you sure you want to perform this action?
Moving path of storage group "HO-EX2007-MB1.exchangeserverpro.net\First Storage Group".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "Y"):y

Now the configuration of the mailbox database is also updated with the new folder path. Again note the use of the -ConfigurationOnly switch.

[PS] C:\>Move-DatabasePath "First Storage Group\Mailbox Database" -EdbFilePath '
F:\DB1\Mailbox Database.edb' -ConfigurationOnly

Confirm
This operation will skip the safety check and make the change to the Active
Directory directory service directly. Do you want to continue?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "Y"):y

Confirm
Are you sure you want to perform this action?
Moving database path "First Storage Group\Mailbox Database".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "Y"):y

Now we can mount the database again.

[PS] C:\>Mount-Database "First Storage Group\Mailbox Database"

Finally, resume replication for the storage group.

[PS] C:\>Resume-StorageGroupCopy "First Storage Group"

The storage group and mailbox database have now been moved to the new locations and are back online. You can verify the health of the storage group by running Get-StorageGroupCopyStatus.

[PS] C:\>Get-StorageGroupCopyStatus

Name                      SummaryCopySt CopyQueueLeng ReplayQueueL
                          atus          th            ength
----                      ------------- ------------- ------------
First Storage Group       Healthy       0             0

You can also use Test-ReplicationHealth to test the CCR cluster.

[PS] C:\>Test-ReplicationHealth

Server          Check                      Result     Error
------          -----                      ------     -----
HO-EX2007-NODE1 PassiveNodeUp              Passed
HO-EX2007-NODE1 ClusterNetwork             Passed
HO-EX2007-NODE1 QuorumGroup                Passed
HO-EX2007-NODE1 FileShareQuorum            Passed
HO-EX2007-NODE1 CmsGroup                   Passed
HO-EX2007-NODE1 NodePaused                 Passed
HO-EX2007-NODE1 DnsRegistrationStatus      Passed
HO-EX2007-NODE1 ReplayService              Passed
HO-EX2007-NODE1 DBMountedFailover          Passed
HO-EX2007-NODE1 SGCopySuspended            Passed
HO-EX2007-NODE1 SGCopyFailed               Passed
HO-EX2007-NODE1 SGInitializing             Passed
HO-EX2007-NODE1 SGCopyQueueLength          Passed
HO-EX2007-NODE1 SGReplayQueueLength        Passed

As a final test you can also verify that MAPI connectivity is working.

[PS] C:\>Test-MAPIConnectivity

MailboxServer      Database           Result    Latency(MS) Error
-------------      --------           ------    ----------- -----
ho-ex2007-mb1      Mailbox Database   Success             8
About Paul Cunningham

Paul is a Microsoft Exchange Server MVP and publisher of Exchange Server Pro. He also holds several Microsoft certifications including for Exchange Server 2007, 2010 and 2013. Connect with Paul on Twitter and Google+.

Comments

  1. I only want to move the System and Log files, not the Database itself. So, can I do as above but just use the Move-StorageGroupPath to set the new logs path?

    e.g. is the DB is on G: and the logs are on C: then the command would be
    Move-StorageGroupPath “First Storage Group” -SystemFolderPath E:\SG1 -LogFolderPath E:\SG1 -ConfigurationOnly

  2. Hi Paul,

    If I only want to remove (delete) a mailbox database and storage group in a CCR cluster, is it just simply remove it from EMC? No need to do anything in Cluster Administrator?

    Best regards,

    Yat

  3. Hi Paul,

    This article was spot on and helped me out of a very big Jam. The only glitch was that I hadn’t done the copy of the DBs on to the passive server so when I mounted the DB and resumed the storage group it failed.

    Once I realised what was wrong I suspended and dismounted the SG and DB again then copied the files.
    I was good to go afterwards.

    Regards

    Vee

  4. Fazal Ur Rehman Shah says:

    Hi Paul,

    We have bought a new storage and need to move the DB to it. I wanted to know whether I just need to copy the DB to the new location or both the DB & logs has to be copied. We have Exchange 2007 CCR and DB & log are on different drives.

    Do let me know how should I proceed.

    Regards,
    Fazal

    • If you only plan to move the database then just the files in the database folder need to be copied.

      • Fazal Ur Rehman Shah says:

        What about the transaction logs ? Do I need to copy those too.

        • You’ve stated that you want to move the DB to new storage, and that the DB and logs are on different drives for your CCR cluster.

          Moving logs and moving DBs are two separate operations. In Exchange 2007 Move-StorageGroupPath is used to move the transaction log path, and Move-DatabasePath is used to move the DB path.

          So, you only need to copy the files for the things you plan to move. If all you want to move is the DB, then only the files in the DB folder need to be copied.

Leave a Comment

*

We are an Authorized DigiCert™ SSL Partner.