Klovera.comBlog
Follow Us:

Transfer Horde emails to a new server

Dustin  |  Programming & Scripting  |  October 5th 2008

We use Horde as one of the webmail solutions on our servers ( also using RoundCube and SquirrelMail ). Occasionally it becomes necessary to move the emails saved on the server to a new server or email account. This can easily be done with the Linux/Unix scp (secure copy) command.

Here’s how to do it:

  1. Copy all email and folders over to the new server using scp. Make sure the email you are copying to is already set up on the new server. Log into the old server via SSH and type the following:
    scp -p -r -P [port] /var/qmail/mailnames/[domain]/[email] root@[IP of destination server]:/var/qmail/mailnames/[domain]/
    

    You will be prompted for the root password of the server you are moving emails to. Once entered in you will view all the files being copied over.

  2. Log into the new server and change the ownership of the files moved. Before you do this the ownership will be root.root and will not show up if you log into Horde.
    cd /var/qmail/mailnames/[domain]/[email]/
    chown popuser:popuser *.* -R
    

Done!

Note: Not all servers are the same, so (like any SSH command) do this at your own risk.

7 Responses to “Transfer Horde emails to a new server”

  1. Bob Dane says:

    Was just wondering how long you have been online and doing this sort of stuff? and what else do you do?

  2. Tim says:

    Hi,
    I tarred the files pushed it over. Did everything you suggested, opened my webmail. But the new mail I moved over from my old server doesn’t show, while I can see a large list while in my shell.

  3. Dev says:

    Hi Dustin,

    I have a horde mailserver which is in one location. I want a another server which is in different palce to take a backup of the mailserver frequently. If suppose the mail sever is down , the backup server has to be online automatically. can you help me on this?

    Thanks
    Dev

    • Dustin says:

      Here is a high level example of how this may work:

      1. First manually test the process of copying the accounts based on the example in the post.
      2. Create an automated process (cron task) to periodically copy the files. The frequency being determined by the need and resources of the servers.
      3. Set up your DNS service to have a secondary name server that points to the backup server. This way if the first one is down the second one will be served up automatically.

      Hope that helps!

  4. Dev says:

    Thank you so much dustin. will try it and get back to you.

Leave a Reply

Klovera is a forward thinking, full service digital agency whose purpose is to bring value to our client's businesses through creativity, strategy, metrics, user experience and technology.