wiki:restore_from_backup

Restore a file from the backup

Only system administrators have access to backups.

See our user description of our backup process.

May First/People Link's backup is run using backupninja. Two backups are defined for every server - an rsync backup to an offsite server run via a shell script and an .rdiff backup to a server in the same colo. In addition, standard servers have a MySQL backup that creates a gzipped dump of every database in /usr/local/db-backup/sqldump (which is in turn included in the rsync and rdiff backups).

The target servers for each backup is defined in our admin scripts. Each defined server has a backup directory, which contains two symlinks. One that points to the rdiff backpu server and one that points to the rsync backup server.

The rdiff backups are incremental, going back five days.

You can restore an rdiff backup by ssh'ing into the backup server and running:

rdiff-backup /home/members/mayfirst/backups/SERVER/rdiff-backup-data/increments/PATH/TO/FILE.DATE /path/to/restore

Example: Recoverying lost email

  1. In clara I found in /etc/backup.d/50_backup.rdiff that the host for incremental backups is luisa.mayfirst.org
  1. From clara, ssh into luisa as the clara backup user
    # source .profile
    # ssh clara-sync@luisa.mayfirst.org
    
  1. Create a backup target directory:
    mkdir restore
    
  1. List increments first and restore the entire Maildir from our earliest backup (the onsite backup goes back 5 days):
    $ rdiff-backup --list-increments rdiff-backup/rdiff-backup-data/increments/home/members/member-name/sites/member-site.org.mx/users/tomas/
    
    $ rdiff-backup rdiff-backup/rdiff-backup-data/increments/home/members/member-name/sites/member-site.org.mx/users/tomas/Maildir.2013-05-02T01\:03\:47-04\:00.dir restore
    
  1. Examine the contents of the backup and identify the files needed.
  1. Exit from luisa into clara
  1. rsync any directories you want:
    rsync -av clara-sync@luisa.mayfirst.org:restore/.INBOX.<something> ticket/
    
  1. Assign right ownership to those files
    chown -R tomas:member-name ticket/*
    
  1. Move them back into the user's Maildir.
    mv  ticket/* /home/members/member-name/sites/member-site.org.mx/users/tomas/Maildir/
    

<< MayFirst Backups

Last modified 7 years ago Last modified on Dec 17, 2016, 6:28:29 PM