-
Notifications
You must be signed in to change notification settings - Fork 825
Restore From Backup
John Rogerson edited this page Jan 19, 2018
·
4 revisions
-
Procure a new VM and install Debian 7.
-
Ensure that no public-facing services are exposed. You don’t want an MTA to send you mail while you’re in the middle of rebuilding your server. If this is a new VM with a new IP, then it’s not an issue. Just wait until the end of the procedure to switch the DNS over.
-
Prep the server (https://github.com/al3x/sovereign#3-prep-the-server)
-
Run the playbooks (assuming you still have a local repo with your certs, keys, and variables intact)
-
Stop all services.
/etc/init.d/monit stop
/etc/init.d/dovecot stop
/etc/init.d/dspam stop
/etc/init.d/exim4 stop
/etc/init.d/opendkim stop
/etc/init.d/postfix stop
/etc/init.d/postgresql stop
/etc/init.d/postgrey stop
/etc/init.d/tomcat6 stop
/etc/init.d/znc stop
- Determine which archives to restore
root@vps3:~# tarsnap --list-archives | sort
- Restore each one in a
screen
window. It might take a while — I only got ~2Mbps on each tarsnap restore command. By running all of the restore commands simultaneously you can get a higher aggregate download rate.
tarsnap -x -v -C / -f 20140506-030001-daily-decrypted
tarsnap -x -v -C / -f 20140506-030001-daily-home
tarsnap -x -v -C / -f 20140506-030001-daily-root
rm -rf /var/lib/postgresql/9.1/main
tarsnap -x -v -C / -f 20140506-030001-daily-var/lib/postgresql/9.1/main
rm -rf /var/www
tarsnap -x -v -C / -f 20140506-030001-daily-var/www
-
Switch the DNS over to your new server's IP
-
Update your DKIM DNS records, since your new server will have generated new keys.
-
Turn on the services