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.
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.
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.
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
As 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.
6. Click yes to the warning.
In the image below you can see the mailbox database is disomounted.
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.
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.
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”
So 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
You 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
As 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
You 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.
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:
- Exchange 2013 Cumulative Update installation tips and best practices
- How to install Exchange 2013 (SP1) on Windows Server 2012 R2
- Exchange 2013 Initial Configuration Settings
- Exchange 2013 Initial Configuration Settings: Setting SMTP accepted domains (Part 1)
- Exchange 2013 Initial Configuration Settings: Setting email address policies (Part 2)
- Exchange 2013 Initial Configuration Settings: Rename and move the default mailbox database and logs (Part 3)
- Exchange 2013 Initial Configuration Settings: Change mailbox size limits (Part 4)
- Exchange 2013 Initial Configuration Settings: Create a send connector (Part 5)
- Exchange 2013 Initial Configuration Settings: Set the offline address book (Part 6)
- Exchange 2013 Initial Configuration Settings: Enter the Product Key (Part 7)
- Exchange 2013 Initial Configuration Settings: How to configure a Postmaster Address (Part 8)
- Exchange 2013 Initial Configuration Settings: How to change the FQDN on the default frontend receive connector (Part 9)
- Exchange 2013 Initial Configuration Settings: How to configure the virtual directories (part 10)
- Create and apply an SSL certificate (work in progress)
Greate article. Helped me a lot. Thanks mate!