Keeping emails after migration

Discussion in 'General' started by lnxgs, Dec 1, 2022.

  1. lnxgs

    lnxgs Member

    Hello,
    I need to reinstall the ispoconfig server switching from Debian to Ubuntu (formatting it).
    I use last version of Ispconfig.
    I need to keep the mail accounts (and email messages). What can I do?
    Can I compress vmail folder and then replace it in the new installation after recreate all email account on ispconfig panel?
    Regards,
    L.
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    If you have two hosts, install Ubuntu to a new host, then ISPConfig Migration tool to copy data from old to new. You can then get rid of the Debian host.
    If you only have one host, it is trickier. Backup the necessary data and figure out how to restore it after installing Ubuntu.
     
    ahrasis likes this.
  3. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

  4. lnxgs

    lnxgs Member

    No, the host is the same.
    I need to backup everything, move it, reinstall o.s. + ispconfig and restore websites and mails.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Does the server run email services only?
     
  6. lnxgs

    lnxgs Member

    no, the server has some websites (wordpress) and a dozen of email accounts.
    email accounts are owned by me (I know all passwords), no need to be up during the migration (I hope can last 3-4 hours).
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, but only the emails shell gets migrated to the new installation and not the websites?
     
  8. lnxgs

    lnxgs Member

    I would like to replace the Debian operating system with Ubuntu that has new PHP on a physical server.
    So I need to push everything out of the server. Format it, install Ubuntu e setup Ispconfig again. Then reconfigure ispconfig and upload all websites. That it's possible, because I already did it the past.
    This time, I would like to "restore" email accounts (with mails), if it possible.
     
  9. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    that part should be simple enough. the accounts are stored in the ispconfig database, so restoring that and resyncing should remake all the email folders.
    so it should just be a case of backing up /var/vmail to an external location, then rsync it back after you've restored and resynced ispconfig.
     
  10. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  11. lnxgs

    lnxgs Member

    I will try this solution. then I'll let you all know.
     
  12. lnxgs

    lnxgs Member

    Unfortunatelly I failed the upgrade.
    The automatic installation will install too many thing and use MariaDB which is not compatible with Mysql 8, as I used before.
    So I need to reinstall the server again in manual.
     
  13. lnxgs

    lnxgs Member

    As I promised:

    Add email domain and email boxes on ispconfig panel.
    Suppose you have decompress the vmail folder content to a directory of the ispconfig server.
    Here you should see folder named example.com, where example.com is the domain of you email address.

    Copy the content of the email of the user mary ([email protected]) to the email server directory:
    cp -r example.com/mary/ /var/vmail/example.com/

    Then replace all owner of the mary folder with vmail:
    chown -R vmail:vmail /var/vmail/example.com/mary

    Done.
     
  14. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    once you've recreated all the mailbox accounts, you should be able to just rsync the entire /var/vmail backup copy back to /var/vmail on the new server, which should also keep all ownership/permissions/timestamps etc. so no need to chown anything afterwards.
     

Share This Page