1

Topic: Complete backup

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.7
- Linux/BSD distribution name and version: Ubuntu 16.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I have my mostly working system now - yah!

I'm still making lots of changes and have blown the system up several time and reinstalled as I learn.  Which is mostly the point.

I set up a Dropbox command which will let me copy from my server to Dropbox.  I'd like to come up with a command to capture all my config files and emails and stuff them up to Dropbox so that my 'learning' can be reversed.

Is there somewhere to look for an exhaustive list of directories to copy to end up with a working system after I reinstall an identical but bare iRedMail?

In other words, worst case I re-image the VPS and do a reinstall and then copy the Dropbox down to the system and voila!

Thoughts?


Andrew

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Complete backup

Unfortunately, we currently don't have such list.

3

Re: Complete backup

Unfortunately it's never that easy to transfer a server! Here is an rsync command though that use when transferring to a new server (remember databases need to be imported too which is kinda separate but backup databases are included in the list below). Applies to iRedMail server with Nginx. Be very careful with this if used to import directly into the file locations instead of something like /srv/server.old or /home/user/server.old

rsync -ahPv --delete \
--include=etc \
--include=etc/aliases \
--include=etc/amavis \
--include=etc/amavis/conf.d \
--include=etc/amavis/conf.d/50-user \
--include=etc/default \
--include=etc/default/iptables \
--include=etc/dovecot \
--include=etc/dovecot/dovecot.conf \
--include=etc/fail2ban \
--include=etc/fail2ban/fail2ban.conf \
--include=etc/fail2ban/jail.local \
--include=etc/iredmail-release \
--include=etc/nginx************************* \
--include=etc/php \
--include=etc/php/7.0 \
--include=etc/php/7.0/fpm \
--include=etc/php/7.0/fpm/php.ini \
--include=etc/postfix \
--include=etc/postfix/aliases \
--include=etc/postfix/main.cf \
--include=etc/postfix/master.cf \
--include=etc/postfix/smtp_header_checks \
--include=etc/ssh \
--include=etc/ssh/sshd_config \
--include=etc/ssl************************* \
--include=home \
--include=home/user************************* \
--include=opt \
--include=opt/iredapd \
--include=opt/iredapd/settings.py \
--include=opt/www \
--include=opt/www/roundcubemail \
--include=opt/www/roundcubemail/config \
--include=opt/www/roundcubemail/config/config.inc.php \
--include=var \
--include=var/lib \
--include=var/lib/dkim************************* \
--include=var/vmail \
--include=var/vmail/backup************************* \
--include=var/vmail/vmail1************************* \
--exclude=* \
--copy-links \
--log-file="/server(date +%Y-%m-%d_%H%M%S).log" \
--progress --stats \
user@server:/ /server.old

4

Re: Complete backup

Or another way to do it is to use something like Ansible <https://www.ansible.com/> to build your server from scratch. As you make changes Write ansible tasks to make those changes. When you get it to the state you want, tear it down and rebuild it and see what you missed. Wash, rinse, repeat. For the databases and mailboxes build a set of tasks to backup the volitle data. After a while you will find that you will have a playbook that makes it trivial to duplicate your machine.

The downside is that it takes a lot of time to do it right but it is possible.

Regards,

Tom

5

Re: Complete backup

Also one can use a virtual machine and utilize the snapshot feature.

6

Re: Complete backup

schnappi wrote:

Also one can use a virtual machine and utilize the snapshot feature.

schnappi wrote:

Also one can use a virtual machine and utilize the snapshot feature.

I am using a virtual machine - woothosting doesn't have a backup feature for the product I use.  That would be the best/easiest answer <g>

Andrew

7 (edited by schnappi 2017-09-15 22:10:01)

Re: Complete backup

OVH has snapshots for an additional fee, base prices lower and hardware specs higher than woothosting.

8

Re: Complete backup

schnappi,

Perhaps I'm missing something.  My package from woothosting contains

2 CPU
2 GB Ram
2 GB Swap
1 GB ethernet port
150 GB SSD
3 TB of monthly bandwidth

I'm paying $18/year in either NY or Miami  - I have one in each location and Miami wasn't impacted by the storm.

OVH doesn't seem to match these specs or price - does OVH have a specials page which I didn't see?  Otherwise, they seem more expensive.



Andrew

9

Re: Complete backup

Base prices lower/ base hardware higher if need to build dedicated (or virtual) servers regularily. You have a good deal now for $18/ year.

Really only real difference/ only time it matters between OVH and any of millions others is when have very significant bandwidth.

Could go Inception route and run a virtual machine within your virtual machine with an additional IP and take snapshots this way if really wanted snapshots.