Synchronising WordPress Sites – Uncompressed WordPress Scheduled FTP Backup?

So I have a wordpress site on a server, but the server is a little flakey and I’d like to have an identical site setup on a second server so I can switch to it when the server finally gives up the ghost. For arguments sake, lets call the server it’s sat on Server1 and the new server Server2.

Essentially what i’d like is some sort of FTP and MySQL scheduled one directional sync. Where any changes on Server1 are then actioned on Server2 and so it’s always up to date.

Read More

Perhaps one of the ways I could do this would be by utilising some of the thousands of plugins that already exist, so really I am looking for some help or a more suitable alternative method.

In my head I’d have 2 plugins for my wordpress site, an FTP sync which backsup an uncompressed version of the site from Server1 to Server2. Then another plugin which backs up the database.

Alternatively, are there any schedules backup/restore apps that people know of? The scheduled restore seems to be the slip up in general.

Note that I also have access to Amazon S3, Dropbox and Google drive if needed, however i’d prefer to go directly between Server1 and Server 2 for this.

Thoughts on how to make this happen would be great

Related posts

1 comment

  1. I have a similar situation, and here’s what i do (with bonus file history on the backup server, in case you get hacked and need to roll back to yesterday in a hurry).
    For the database mysqlbackup is quick and good (as is the percona XtraBackup) – install one of them on your primary server. I use lftp on the backup server, and I have an lftp bookmark for the remote site. And i have a local git repository on the backup machine so i can always roll back to a good version. Here’s a little script :

    # backup the remote database
    ssh -e "xtrabackup --backup --target-dir=/webroot/databaseBackup";
    # change to local webroot (whereve that is for you)
    cd /webroot
    # copy remote website files to backup server (with some helpful output filters)
    lftp bookmarkName -e "mirror --verbose ;quit" | grep -E "Transfer|Permission";
    # check in to local git repository
    git add . && git commit -m "scheduled backup" 
    # Restore the database every night (this is a cut'n'paste from the percona site, mine is more complicated)
    service mysql stop  # this will depend on your linux distro, maybe /etc/init.d/mysql stop
    rsync -rvt --exclude 'xtrabackup_checkpoints' --exclude 'xtrabackup_logfile' /webroot/databaseBackup /var/lib/mysql
    chown -R mysql:mysql /var/lib/mysql/
    service mysql start
    

    I save that to a file on the backup server, then add a cronjob (i do this once a day at 3:51am). If you set up cron to email you the results of each job, you’ll get a daily email telling you which files changed.

    51 03 * * * ~/bin/remoteBackup.sh
    

    Every morning I get an email letting me know the backup has succeeded, with a list of files which changed since yesterday (usually just cache files, sometimes new content, occasionally hackers). It’s great.

Comments are closed.