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.
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
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 :
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.
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.