Exchange 2013 Initial Configuration Settings: Rename and move the default mailbox database and logs (part 3)

Exchange 2013 logo

Following on from the previous post Exchange 2013 Initial Configuration Settings: Setting default email address policies (Part 2), in the third part of the series I’ll look at renaming the mailbox database.

To help with Exchange Server management it is important to keep things as simple and logical as possible, and a properly named mailbox database can greatly aid in the administration of the server. Give it a unique descriptive name to your company for example e.g. OxSBSEngineeringMailbox01 or OXSBS-MBX-Execs-01, and once you have created a naming convetion stick to it.

In this example because I mostly work with SMEs who have one mailbox database so I’m going to call our database OxfordSBSGuy-Users-MBX01 for to me this means OxfordSBSGuy Users Mailbox Database 01.

Rename the mailbox database

1. In the Exchange admin center (https://localhost/ecp) click servers from the left hand menu and then click on databases. You can see below we have one mailbox database.

Exchange 2013 - servers - database

2. Click view details to examine the mailbox database. Here you can see the actual database name is Mailbox Database 1010338682. Once you’ve finished viewing click cancel.

Exchange 2013 - servers - database -view details

3. Highlight the database and click the pencil icon to edit the mailbox database. Here you can change the mailbox database display name, but not the actual edb file name. Type in the new mailbox database name and click save.

Exchange 2013 - servers - database - edit mailbox database name

4. To change the mailbox database file name to be the same as the display name to avoid any confusion we need take the database offline and then use the PowerShell cmdlt Move-DatabasePath. When you take the mailbox database offline any mailboxes that use the database will be unavailable, so this is a planned maintenance or pre-production change.

First lets take a look at the mailbox database properties. Use the following cmdlet:

Get-MailboxDatabase | fl

Get-MailboxDatabase flGet-MailboxDatabase fl 2Get-MailboxDatabase fl 3As you can see there are quite a lot of attributes, but the ones we are interested in are called EdbFilePath, and LogFolderPath.

5. So let’s dismount the databse. In the Exchange admin center, right click the mailbox database and click the three dots symbol, and then click dismount.

Exchange 2013 - EAC - servers databases - dismount

6. Click yes to the warning.

warning - are you sure you want to dismount database.In the image below you can see the mailbox database is disomounted.

Exchange 2013 - EAC - servers - databases - dismounted

The PowerShell cmdltes to perform the same dimounting operation are detailed below. First we check the database mounted status, then we dismount the database, pressing Y to confirm, then we recheck the status is dismounted.

Get-MailboxDatabase -status | ft name, mounted -autosize    will display all mailbox databases and their mounted status.

Get-MailboxDatabase | Dismount-Database     will pass all databases returned by the Get-MailboxDatabase cmdlet to the Dismount-Database cmdlet.

Get-MailboxDatabase status Get-MailboxDatabase Dismount-Database

7. Now the mailbox database is dismounted we can use the Move-DatabasePath cmdlet to rename it.

First a quick double check of where the current paths are:

Get-MailboxDatabase | fl Name, EdbFilePath, LogFolderPath   this will just return the two paths we are interested in.

Get-MailboxDatabase fl name EdbFilePath LogFolderPath

Now let’s rename the edb file, the structure is Move-DatabasePath -Identitiy mailboxname -EdbFilePath FilePath -LogFolderPath FilePath. My database is pretty small as it is a new installation, but if you are doing this on an existing database I suspect it will take a while depending on the size of your database.

Type the command:

Move-DatabasePath -Identity OxfordSBSGuy-Users-MBX01 -EdbFilePath “C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Mailbox Database OxfordSBSGuy-Users-MBX01\OxfordSBSGuy-Users-MBX01.edb” -LogFolderPath “C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Mailbox Database OxfordSBSGuy-Users-MBX01”

Move-DatabasePath identity EdbFilePath LogFolderPathSo in the image above you can see I’ve renamed the database and moved it to a folder called the same as the database.

8. Now we need to mount the database, you can do this in the Exchange admin center in the same location as the dismount option, but as we are in the Exchange Management Shell we’ll do it in PowerShell.

Type the command:

Get-MailboxDatabase | Mount-Database

Then type the command:

Get-MailboxDatabase -status | ft Name, Mounted -autosize

Get-mailboxdatabase mount-databaseYou have now renamed the mailbox database.

Move the mailbox database

In an ideal world your mailbox database won’t live on C:\ but on its own storage, and the log files will live on their own storage too separate from the database. In my test lab I have an additional drive I am going to move them too in the next example.

Depending on the size of your database this could take a considerable amount of time so it is a planned maintenance operation or pre-production.

First we’ll check the database status

Get-MailboxDatabase -status | ft Name, Mounted -autosize

As we only have one database we can pass Get-MailboxDatabase straight to Dismount-Database. If you have more than one database the alernative would be to use Dismount-Database -Identity databasename.

Get-MailboxDatabase | Dismount-Database

Next we’ll confirm the existing path of the databse files using the command:

Get-MailboxDatabase | fl Name, EdbFilePath, LogFolderPath

Move mailbox Database 1As you can see above we’ve dismounted the mailbox database and confirmed the current paths.

The next five commands can all be seen in the image below, first we can confirm it is dismounted using the command:

Get-MailboxDatabase -Status | ft Name, Mounted -Autosize

Then use the Move-DatabasePath cmdlet to move the database and logs from C:\ to E:\.

Move-DatabasePath -Identity OxfordSBSGuy-Users-MBX01 -EdbFilePath “E:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Mailbox Database OxfordSBSGuy-Users-MBX01\OxfordSBSGuy-Users-MBX01.edb” -LogFolderPath “E:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Mailbox Database OxfordSBSGuy-Users-MBX01”

Next we’ll confirm the existing path of the databse files using the command:

Get-MailboxDatabase | fl Name, EdbFilePath, LogFolderPath

Mount the databse

Get-MailboxDatabase | Mount-Database

And finally a new cmdlet Test-MapiConnectivity to connect to the system mailbox.

Test-MapiConnectivity

Move mailbox Database 2You can now move the mailbox database and log files using PowerShell.

In the next part of the series we’ll log at changing mailbox size limits.

 

Exchange Management Shell Help

Remember in PowerShell to search for a command you can use Get-Command *mailboxdatabase* or GCM *mailboxdatabase* to list all the cmdlets that contain the phrase mailboxdatabase.

GCM mailboxdatabase

To view help you can use Get-Help before any command, and you can append -examples, -detailed, -full, -online for further information.

For the other articles in this series please go to:

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.