Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WORDPRESS BACKUPS. DISASTER MANAGEMENT AND RECO...

WORDPRESS BACKUPS. DISASTER MANAGEMENT AND RECOVERY - WordCamp Poznan 2018

Imagine this. You are earning thousands of euros everyday from your website. And you wake up and see your message. Spooky is not it? Well, it's just a problem, it's just a hacked DDOS attack, malware, or your server crashing. Are you ready for all this?

Well lets not scare you further and give you a solution and backups in WordPress! We will hear about both manual and automated processes.

We will talk about the different aspects of backups. What to backup? Where to backup? How to backup? Goes without saying that the audience would be used. We will hear about the tools and techniques to both automatic and manual backups.

Finally we will move a little deeper into the technicalities using WP-CLI and a team of WP-CLI and talking about a brief discussion on WP-CLI them securely on Amazon S3.

Vineet Talwar

July 08, 2018
Tweet

More Decks by Vineet Talwar

Other Decks in Technology

Transcript

  1. Background Revenue Loss ? Hard drive crashed ? Got hacked

    ? Nature’s attack ? Malware Attack ? Data loss ?
  2. Overview • Backup strategy ? • What ? Where ?

    And How ? • Relevance of your data? • How often do you need to access backups ? • Mission Critical Backups ?
  3. What do I Backup? • Document Root + Database dump

    • wp-config.php • wp-content/ • wxr file • Server config
  4. And Where? • Local Machine / Personal Computer • Your

    Local NAS Server • Google Drive/Dropbox • Your own server (EC2+EBS/EFS) • AWS S3 Buckets • AWS Glacier
  5. Tools • FTP and PHPMyAdmin • Git (Version Control) •

    WP-CLI • Cron Jobs • Shell Script • AWS S3 Buckets • AWS S3 CLI
  6. Manual Backups • FTP and Database dump • WP-CLI: $

    wp db export - Database Dump $ wp export - wxr File
  7. Plugins way? • Git Version Control (.gitignore?) • Plugins: WordPress

    Importer Exporter, BackupWP, Duplicator, WP DB Backup, Better Search-Replace
  8. singlebackup.sh cd /var/www/html/example.com; /usr/local/bin/wp db export ; /usr/bin/zip -R "example-$(date

    +"%d-%m- %Y").zip" '*.sql'; mkdir -p "../backups/db/$(date +"%Y-%m")/" ; mv '*zip' "../backups/db/$(date +"%Y-%m")/" ; rm '*.sql' ;
  9. 100 WP installations ? for dir in /var/www/html/*; do cd

    "$dir" && /usr/local/bin/wp db export ; ... done
  10. Sync to S3 • Configure AWS S3 CLI /usr/bin/aws s3

    cp “../backups/db/" s3://yourbackups/example.com/sql/ --recursive
  11. 100 Installs ? - Sync to S3 for dir in

    /var/www/html/*; do cd "$dir" && /usr/local/bin/wp db export ; mkdir -p "../backups/db/$(date +"%Y-%m")/" ; /usr/bin/zip -R "$dir-$(date +"%d-%m-%Y").zip" '*.sql’ ; mv "$dir-$(date +"%d-%m-%Y").zip" "../backups/db/$(date +"%Y-%m")/" ; rm '*.sql' ; /usr/bin/aws s3 cp "../backups/db/" s3://yourbackups/db/"$dir" --recursive; done
  12. Crontab $ crontab –e 0 3 * * * sudo

    /home/user/ss/takebackup.sh Tool: https://crontab.guru/