Coder Social home page Coder Social logo

nicolasloew / backup-wordpress Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pothi/backup-wordpress

0.0 0.0 0.0 83 KB

Shell scripts to take local and remote backups of WordPress (database and files) via server cron.

Home Page: https://www.tinywp.in/

License: MIT License

Shell 91.23% Ruby 8.77%

backup-wordpress's Introduction

Backup-Wordpress

Scripts to backup WordPress via server cron (cPanel, Plesk, etc)

There are plenty of plugins available to take backups within WordPress. However, the scripts mentioned here work outside WordPress making them much more effective and efficient. If you take offline backups, I highly recommend to use encryption and limit your offline storage to only allow one-way backups.

Features

  • No plugin to install. So, no plugin conflicts!
  • Single script to take backups of multiple sites.
  • Separate script to take (nightly) files backup without uploads directory!
  • Local and offline backups are supported.
  • Automatic deletion of local backups.
  • Support for sub-directory installation of WordPress!
  • Support for simple encryption using GnuPG

Roadmap

  • Ability to choose the compression method.
  • take only local backups or only remote backups or both.
  • ability to remove local backups when taking only remote backups.
  • single script to take all sorts of backups.
  • close integration with wp-cli (probably as a plugin).
  • alert when local storage reaches a limit.

Requirements in the server

  • wp-cli
  • aws-cli and/or gsutil (optional, to take offline backups)
  • SSH access
  • mysqldump
  • zip, tar, or bzip
  • enough disk space to hold local backups
  • gpg for encrypted backups (optional, but helps to comply with GDPR).

What does each backup script do?

  • db-backup.sh can take database backup with --add-drop-table option.
  • files-no-uploads-backup.sh can take files backups without uploads folder to reduce the overall size of the backup. Ideal for nightly backups!
  • full-backup.sh can take full backup including database (that is named db.sql and is available at the WordPress core directory). Ideal for a weekly routine!

Where are the backups stored?

  • local backups are stored in the directory named ~/backups/. If it doesn't exist, the script/s would attempt to create it before execution.
  • offline backups can be stored in AWS (for now). Support for other storage engines (especially for GCP) is coming soon!

How to take backups?

  • firstly, go through each script and fill-in the variables to fit your particular environment. Currently, it is assumed that the WordPress core is available at ~/sites/example.com/public.
  • please adjust the number of days to keep the backup, depending on the remaining hard disk space in your server.
  • test the scripts using SSH before implementing it in system cron.
  • note: you may take backups of multiple domains like the following...
/path/to/db-backup.sh example1.com
/path/to/db-backup.sh example2.com
/path/to/db-backup.sh example3.com

The above is applicable to all the scripts!

Contributors

The following people have contributed to this repo in various ways...

How to decrypt, if I used a passphrase

gpg --batch --passphrase your_passphrase encrypted_file.tar.gz.gpg

Can you implement it on my server?

Yes, of course. But, for a small fee of USD 5 per server per site. Reach out to me now!.

I have a unique situation. Can you customize it to suit my particular environment?

Possibly, yes. My hourly rate is USD 50 per hour, though.

Have questions or just wanted to say hi?

Please ping me on Twitter or send me a message.

Suggestions, bug reports, issues, forks are always welcome!

backup-wordpress's People

Contributors

pothi avatar cicciodev avatar nik-lampe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.