Migrating from courier-imap without passwords using Imapsync

Revision as of 16:36, 11 August 2009 by Msallee (talk | contribs) (New page: == Migrate e-mail accounts from courier-imap, postfixadmin to zimbra without having user passwords == First, we needed to pull the account names and passwords from postfixadmin over to th...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Migrate e-mail accounts from courier-imap, postfixadmin to zimbra without having user passwords

First, we needed to pull the account names and passwords from postfixadmin over to the new Zimbra system. This article demonstrates a php script that did the job well, querying the encrypted passwords from the MySQL backup into a file:

http://wiki.zimbra.com/index.php?title=Password_Migration[1]

Using the exported.sh file, which runs zmprov, it created the users on Zimbra and was able to set their passwords. You may want to grep out all the 'zmprov ma username' lines into another file called reset_passwords.sh to run to reset passwords later, and add #!/bin/bash on the top line to make it a script, also do chmod +x reset_passwords.sh to make it executable. At this point, we want to change the passwords to something all the same for the imapsync migration - add it to the 'zimpassfile2' file specified in the imapsync command.

Migrating e-mail using imapsync was complicated when trying to use the --auth-user postfixadmin 'super-user' option, so we decided instead to create a new e-mail account via postfixadmin, called migration1, set a password, and then manually change the symlink for the mail folder in this way:

ln -s /usr/local/virtual/jbond@domain.com /usr/local/virtual/migration1@domain.com

Then running imapsync worked:

/usr/bin/imapsync --buffersize 8192000 --nosyncacls --subscribe --syncinternaldates --host1 postfixserver.domain.com --user1 migration1 \
--passfile1 zimpassfile1 --host2 zimbraserver.domain.com --user2 jbond@domain.com --passfile2 zimpassfile2 --noauthmd5

(I'm sure there are better ways to script all of this. Anyone who wants to add this, it will be welcomed.)

Then delete the symlink and relink it for the next user, so you can run imapsync again:

rm /usr/local/virtual/migrate1@domain.com; ln -s /usr/local/virtual/drno@domain.com /usr/local/virtual/migration1@domain.com

After all the accounts have synced, use the reset passwords script (which you grepped out of exported.sh) that contains the 'zmprov ma' commands to reset all user passwords to the same as they had on the old mail server.

MS

Jump to: navigation, search