Migrating to New Web Hosting Service

Migrating to a new hosting service is a pain, but inevitable... until you land at Webfaction, of course ;-)

Migrating e-mail accounts

Migrating e-mail accounts is the biggest pain because its a dynamic system, and you don't want any e-mails getting lost. Unlike a dynamic website, which can be put into "maintenance mode" during the migration, you can't stem the flow of e-mails coming in. In addition, users will be using POP or IMAP in various ways and may or may not be storing old messages on the server.

This is the process we have been developing to migrate e-mail accounts TO Webfaction from another host. It is a manual process, and so fairly cumbersome, but it has three key benefits:

  1. all of the work can be done BEFORE the DNS entry is updated to point the domain to the new host. In fact, users can start checking their e-mail on the new service even before the DNS entry propagates!
  2. no e-mail messages will be lost and all messages stored in the user's mailbox will get transferred to the new service.
  3. minimal hassle for the user - they simply need to create a new account in their e-mail client for the new service.

Assumption: this process requires that you have a second, clean domain name available at the new service. Luckily, Webfaction makes this easy by providing a permanent domain: - sweet.

The Process

To simplify the language, we'll assume we are migrating e-mails on domain from HostMDS to Webfaction. We have the permanent domain name at webfaction:

  1. Create a list of all e-mail accounts. Make a note of any forwarders or other special configurations for each account. Use a spreadsheet to keep track of the accounts, the new temporary passwords, and what work has been completed on each account.
  2. On the webfaction panel, add the domain name you are migrating (e.g., - you can do this, even though the DNS entry is not pointing to webfaction yet.
    • you now have 2 domain names on the new service (e.g., and, although the DNS currently routes traffic only to one of them (e.g.,
  3. for each e-mail address:
    • Create a mailbox for the user and select a new password.
    • Make a note of these details in your spreadsheet.
    • Create 2 e-mail addresses with the exact same username - one for the webfactional permanent domain and one for the migrating domain (e.g, and ) - point both addresses at the user's mailbox.
    • Create any forwarders, etc. for the account.
  4. for each e-mail user:
    • send instructions for creating a new account in their e-mail client with settings for the new hosting service (e.g. webfaction), including the user's new ID and P/W on the new service.
    • a sample e-mail template with these instructions is provided as an attachment below.
    • this should be done several days before the switch to ensure user gets the message before losing access to the old service.
  5. Set-up a domain forwarder on the old service (e.g. HostMDS) to forward all e-mail from your normal domain (e.g., to your permanent domain (e.g.,
    • I actually found that the domain forwarder did not work. However, the new CPanel had an "Import Email / Forwarder" utility that I could basically feed a simplified version of my spreadsheet to:
    • OR set-up a forwarder on each account to forward to the permanent domain e-mail address (e.g., user@…)
  6. Leave 2 - 4 days for users to get message and configure their e-mail clients
    • during this period, e-mail will go to both the old and new accounts (via the forwarder) - so users can transition on their own time.
    • if a user does not get the message in time, the consequence is they will need to be given these instructions in some other way (e.g., verbally), since they will no longer have access to their e-mail on the old service.
  7. Migrate Existing Mailboxes (see below)
    • at this point you may want to disable or change p/w's on the old service so users are forced to use the new service - this will reduce the number of duplicate messages they receive.
  8. Proceed with updating the DNS entry at your leisure...
    • At this point, all old messages are now stored on the new host, and all incoming e-mail is being forwarded to the new host, and the user is able to check their e-mail on the new host.

Once the DNS change propagates, you could delete the e-mail addresses on the permanent domain (e.g.,, or leave them there, they do no harm - no-one but you even knows they exist!

Migrate Existing Mailboxes

To migrate all messages from the existing server to the new server, there are several options:

  1. let each user do it themselves, using a tool like Horde's backup and restore
  2. use MailJumpr web-tool to transfer each user's mailbox to the new server (e.g., from server to )
    • Issues:
      • manual process - one e-mail at a time.
      • must know each user's password on both servers (i.e., you'll need to change each user's p/w on old host)
      • does not preserve mail flags (e.g., read)
      • does not appear to migrate the "sent" folder
  3. use imapsync Perl script to transfer the mailboxes to the new server.
    • can use admin user / pw on source server, so no need to know individual user's p/w
      • we were unable to get this working on MDS, so had to change each user's p/w.
    • can be automated with a small shell script to run through a list of users
      • example of such a script is attached below
Last modified 7 years ago Last modified on Jan 20, 2011 5:18:05 AM

Attachments (1)

Download all attachments as: .zip