Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Move exchange 2007 mailboxes from one DB to another DB on different Exchange server

Posted on 2013-06-06
Medium Priority
Last Modified: 2013-06-10
I'm looking for a powershell command to bulk move mailboxes in Exchange 2007.  I want to move them from one server "DB" to my new Exchange server "DB".
Question by:tomfontanilla
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 40

Assisted Solution

Subsun earned 800 total points
ID: 39227709
Get-Mailbox -database DB01 | Move-Mailbox -TargetDatabase DB02 -MaxThreads 10

Open in new window

LVL 10

Accepted Solution

Marshal Hubs earned 1200 total points
ID: 39228192
To move a single exchange 2007 mailbox within powershell from one database to another you would use the following command.

Move-mailbox –identity “%username%” –targetdatabase “%DB%”
This would be the equivalent of right clicking on a user object with the exchange console and choosing move mailbox. However the real power of powershell comes into play when you want to move multiple mailboxes from one database to another. In order to do that you would combine the move-mailbox cmdlet with get-mailbox. A simple usage would be something like.

Get-mailbox | move-mailbox –targetdatabase “%DB%”
This would move all mailboxes on the exchange server to the target database, however you may find that you already have a few mailboxes on the target database or you want to move users from a specific database to another database (if you had 3 databases for example). For this you could use:

Get-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.

Author Comment

ID: 39228724
Experts, your recommendation is great. The only problem is that i also need to point to which storage group. Please advise.
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

LVL 40

Expert Comment

ID: 39228769
Get-Mailbox -database "Server name\Storage Group\DB01" | Move-Mailbox -TargetDatabase "Target Server\Storage Group\DB02" -MaxThreads 10

Open in new window


Author Comment

ID: 39230757
Looks good, I will try this tonight.

Author Comment

ID: 39230767
Can you please cofirm this.

Get-Mailbox -database "server\Small Companies\Small Companies_DB" | Move-Mailbox  –identity "username"-TargetDatabase "Target server\Capacity Covergae Small Companies\Small Companies" -MaxThreads 10
LVL 40

Expert Comment

ID: 39230777
If you want to move all mailboxes from one DB to another then you don't have to specify –identity "username" in command..
Get-Mailbox -database "server\Small Companies\Small Companies_DB" | Move-Mailbox -TargetDatabase "Target server\Capacity Covergae Small Companies\Small Companies" -MaxThreads 10 

Open in new window


Author Closing Comment

ID: 39235426
Great Response

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question