Import Mail Accounts and websites from ISPConfig

Discussion in 'General' started by Divya Muthukumar, May 29, 2023.

  1. Divya Muthukumar

    Divya Muthukumar New Member

    Hello Team,

    I have ISPConfig running on Ubuntu 16.04, and we plan to copy all mail accounts from the old ISPConfig to the new ISPConfig running on Ubuntu 20.04.
    How to manually import/export a list of sites and mail accounts from an old ISPConfig and then deploy it to a new ISPConfig.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    If its just email and no websites, then a manual migration is quite easy, you just have to copy over the ISPConfig database and the /var/vmail directory and then run Tools > Resync on the email part to write new config files. There are several threads here in the forum on this topic btw.
     
    Divya Muthukumar likes this.
  3. Divya Muthukumar

    Divya Muthukumar New Member

    Hello Till,

    There is 'n' number of email accounts move from old ISPConfig to new ISPConfig. Is that possible

    you just have to copy over the ISPConfig database and the /var/vmail directory and then run Tools > Resync on the email part to write new config files:
    Can you please elaborate this content,
    1.Should i copy the whole vmail directory
    2.After copying all files from vmail, how it work from resync.

    Kindly pour your suggestion. it would be really help.
     
  4. pyte

    pyte Well-Known Member HowtoForge Supporter

    If you want to migrate every mailbox in there yes. In the panel under Tools(or Settings) -> Resync Tool and sync all the mail related stuff.
     
    Divya Muthukumar and ahrasis like this.
  5. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    As ISPConfig is based on php and mysql, thus, after database and necessary files are transferred, resync will basically read the data kept / maintained in the ISPConfig database and write them back as the new config files.
     
    Divya Muthukumar likes this.
  6. Divya Muthukumar

    Divya Muthukumar New Member

    Thanks for the information.
    Just need one more clarification, I can copy the ISPConfig DB and /var/vmail directory but without giving the destination anywhere, how the migration will happen.
    Please advise how to migrate the mailbox to my destination ISPconfig
     
  7. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    the details and configuration for all email accounts is in the ispconfig database.. if you've copied that over and it's working fine on the new server, just resync services in ispconfig and all the mailbox folders will be recreated for you.
    then just copy / sync over /var/vmail from the old server to the new server.
     
    ahrasis likes this.
  8. pyte

    pyte Well-Known Member HowtoForge Supporter

    You can use rsync to copy over the Maildirs form one server to another. I've made a little script for my migration from an old non-ISPConfig server to ISPConfig

    Code:
    mailboxes=`find /home/vmail -maxdepth 2 -mindepth 2 -type d -printf '%h/%f\n' | sed -e 's/\/home\/vmail\//g/'`
    
    for mbox in $mailboxes
    do
        echo "rsync -av --rsync-path="sudo rsync" /home/vmail/${mbox} [email protected]:/var/vmail/${mbox}/Maildir"
    
    done
    You made need to change paths. The script just echos the rsync command right now, so if you made sure that it is doing what you want to do, just remove the "echo """

    It works fine on my machine :rolleyes:
     
    ahrasis likes this.

Share This Page