Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


What is the best way of backing up my mailbox?
New on LowEndTalk? Please Register and read our Community Rules.

What is the best way of backing up my mailbox?

dennislorrendennislorren Member
edited July 15 in Help

Hey guys,
I'm using Oracle Cloud free ARM instance for my personal email hosting using HestiaCP. I have done the following steps to configure my server.
1. removed the oracle ubuntu and installed Debian minimal.
2. Setup SMTP2GO and Backup MX Server.

Now, my main concern is that one day the server will go poof and all my mail with go with it. How can I backup all my emails so that in case the server goes down, I can easily recover all my emails? Any free solution that can do this? Thanks :)

Comments

  • cazrzcazrz Member

    IMAP?

  • @cazrz said:
    IMAP?

    How do I do that?

  • jarjar Member, Patron Provider

    zip -r home.zip /home

    scp home.zip [email protected]:/home/backupfolder

    Thanked by 2szymonp dennislorren
  • It depends how you have it configured to store mail (or how it automatically does so without giving you an option). If MailDir then you need to backup your ~/MailDir/ directory (and sub-directories of course) if mbox then there will be one file per user usually in /var/mail/. In either case backup these files with your usual method (rsync to somewhere is mine). For mbox you may need to be careful of the size of keeping multiple generations, for maildir as each message is a file then keeping many snapshots can be very space efficient.

    To restore, reconfigure your server and copy in the latest backup. Obviously you need to backup the configuration details (or document them in detail so you can manually recreate them accurately if disaster strikes) as well.

    I actually have a second mail server, hidden from the rest of the world by default, that each day wipes itself and restores from the latest backup, and I login occasionally to make sure recent messages are there (I really should add some automation to that). This tests the backups are working, and gives me an easy way to quickly restore the mail server: have that restore from the latest backup as if it was the daily test, turn off the wipe+restore, and update firewall rules & DNS settings, so it becomes the live server (then duplicate again so I have a new backup service).

  • @jar said:
    zip -r home.zip /home

    scp home.zip [email protected]:/home/backupfolder

    Thanks, I'll give it a try. In order to restore the backup, Do I just copy the home directory or do I need to create the user first in Hestia?

  • @MeAtExampleDotCom said:
    It depends how you have it configured to store mail (or how it automatically does so without giving you an option). If MailDir then you need to backup your ~/MailDir/ directory (and sub-directories of course) if mbox then there will be one file per user usually in /var/mail/. In either case backup these files with your usual method (rsync to somewhere is mine). For mbox you may need to be careful of the size of keeping multiple generations, for maildir as each message is a file then keeping many snapshots can be very space efficient.

    To restore, reconfigure your server and copy in the latest backup. Obviously you need to backup the configuration details (or document them in detail so you can manually recreate them accurately if disaster strikes) as well.

    I actually have a second mail server, hidden from the rest of the world by default, that each day wipes itself and restores from the latest backup, and I login occasionally to make sure recent messages are there (I really should add some automation to that). This tests the backups are working, and gives me an easy way to quickly restore the mail server: have that restore from the latest backup as if it was the daily test, turn off the wipe+restore, and update firewall rules & DNS settings, so it becomes the live server (then duplicate again so I have a new backup service).

    I use HestiaCP. It does all of the things itself. I did a littlt digging. it seems it stores mail files in /home/{user}/mail/{domain}/

  • jarjar Member, Patron Provider
    edited July 15

    @dennislorren said:

    @jar said:
    zip -r home.zip /home

    scp home.zip [email protected]:/home/backupfolder

    Thanks, I'll give it a try. In order to restore the backup, Do I just copy the home directory or do I need to create the user first in Hestia?

    Yeah you'd need to. Probably easier to backup and restore using this though: https://docs.hestiacp.com/admin_docs/backups.html

    Thanked by 1Arkas
  • @jar said:
    @dennislorren said:

    @jar said:
    zip -r home.zip /home

    scp home.zip [email protected]:/home/backupfolder

    Thanks, I'll give it a try. In order to restore the backup, Do I just copy the home directory or do I need to create the user first in Hestia?

    Yeah you'd need to. Probably easier to backup and restore using this though: https://docs.hestiacp.com/admin_docs/backups.html

    I'll look into it. Thank you so much for the help :)

  • i prefer pop3 and smtp. then you have all your mails on your pc.

  • roi22roi22 Member

    Use the built-in backup system of HestiaCP

    Thanked by 1Arkas
Sign In or Register to comment.