How To Migrate Mailboxes Between IMAP Servers With imapcopy
How To Migrate Mailboxes Between IMAP Servers With imapcopyVersion 1.0 This guide explains how you can migrate mailboxes between IMAP servers with imapcopy. imapcopy lets you copy recursively all email messages and folders from one imap account to another. It supports the protocols imap and imaps. I do not issue any guarantee that this will work for you!
1 Preliminary NoteI'm using two Debian or Ubuntu servers here (the procedure should be the same for other distributions, only the installation of Java - which is required by imapcopy - will differ):
I want to migrate the mailbox sales@example.com (username: sales@example.com, password: secret) on server1.example.com to the mailbox sales@example.com on server2.example.com (username and password are the same as on server1.example.com). A note for Ubuntu users: Because we must run all the steps from this tutorial with root privileges, we can either prepend all commands in this tutorial with the string sudo, or we become root right now by typing sudo su
2 Before We StartBefore we start, let's take a look at both mailboxes to see what's in them (you can do this with an email client such as Outlook, Thunderbird, or a web-based email client such as SquirrelMail - I'm using SquirrelMail here). server1.example.com: server2.example.com: After the migration, the three messages on server1.example.com should be available on server2.example.com.
3 imapcopy InstallationIt doesn't matter if we install imapcopy on server1.example.com or server2.example.com - we can even install it on a third, uninvolved server. Java is needed by imapcopy, so we install the package openjdk-6-jre now. In addition, make sure that unzip is installed so that we can uncompress the imapcopy package: apt-get install openjdk-6-jre unzip Next we download and install imapcopy in the /usr/local/imapcopy/ directory as follows: cd /usr/local/ Now we have to make the /usr/local/imapcopy/imapCopy.sh script executable: chmod +x /usr/local/imapcopy/imapCopy.sh
4 Doing The Migrationimapcopy usage is as follows: /usr/local/imapcopy/imapCopy.sh protocol://user[:password]@server[:port] protocol://user[:password]@server[:port] Protocols can be imap or imaps. If usernames are email addresses, replace @ with %40. So the command to copy email messages from sales@example.com on server1.example.com to sales@example.com on server2.example.com is: /usr/local/imapcopy/imapCopy.sh imap://sales%40example.com:secret@server1.example.com imap://sales%40example.com:secret@server2.example.com Here's a sample output: root@server1:/usr/local/imapcopy# /usr/local/imapcopy/imapCopy.sh imap://sales%40example.com:secret@server1.example.com imap://sales%40example.com:secret@server2.example.com On the target server (server2.example.com), you should now see the messages from server1.example.com: server2.example.com:
5 Links
|







Recent comments
21 hours 14 min ago
21 hours 24 min ago
22 hours 10 min ago
23 hours 51 min ago
1 day 12 hours ago
1 day 14 hours ago
1 day 21 hours ago
2 days 7 hours ago
2 days 12 hours ago
2 days 14 hours ago