Talk · The engine

WordPress Backups. Disaster management and recovery

Imagine your website earns money every day, and one morning it’s gone. What to back up, where, how, and how to automate it.

What I covered

  • Backup strategy: what, where and how often
  • Manual backups with FTP, database dumps and WP-CLI
  • Automated backups with plugins and Git
  • Shell scripts and cron jobs that back up 100 sites to Amazon S3
Event
WordCamp Poznań
When
2018
Format
Talk
Series
The engine, 2016–2018
The write-up

Backups are boring until the day they aren’t

Imagine this. Your website earns money every day. You wake up and it’s gone. Hacked, a server crash, a dead hard drive. Then what?

Everyone knows backups are important. In Poznań I talked about the part people skip: actually having a plan.

What to back up

Two things: your files, meaning the whole document root, and your database. One without the other is useless.

Where to keep it

Don’t keep it only on the same server. If the server dies, so does the backup. Keep copies off-site: a cloud bucket like Amazon S3, plus somewhere you control.

How to do it

Manual backups with FTP and a database export work for one site. For anything more, automate. With WP-CLI, a short shell script exports the database, zips the site with a date in the filename, and syncs it to S3. A loop runs it for every site on the server. A cron job runs the whole thing every night at 3am.

Test the restore

A backup you have never restored is a hope, not a backup. Try a restore on a staging server every few months.

I put my scripts on GitHub after the talk. The tools have changed since, but the questions haven’t: what, where, how, and does the restore actually work?

The slides

Invite me · 5 questions

Your stage?

I adapt every talk to the room: developers, marketers or founders. Send me the event, the date and who’s coming.

← All talks