Create backups or restores on your WordPress using a simple Bash script and don't rely on plugins or WP-CLI.
Why should I use it?
- Easy.
- Very fast.
- Multi-site compatible.
- Docker compatible.
- Working with cron and any unix utility.
- Maintains settings, plugins and any important elements.
- Compatible with Linux, MacOS and BSD.
Create a zip file with important files and backup of the database.
./wp-backup.sh backup-all./wp-backup.sh backup-database./wp-backup.sh restore-files [{backup}.zip]./wp-backup.sh restore-database [{database}.sql]./wp-backup.sh restore-all [{backup}.zip]./wp-backup.sh check-database./wp-backup.sh connect-to-database- bash 4.0 or higher
- curl
- zip
- Only macOS users, gsed:
brew install gnu-sed
Go to the WordPress directory (Where are all the files and folders like wp-admin, wp-config, wp-content ...).
cd wordpress-folderDownload script.
curl -o wp-backup.sh https://raw.githubusercontent.com/tanrax/wp-backup/master/wp-backup.shGrant execute permissions.
sudo chmod +x wp-backup.shRun.
./wp-backup.shEnter the container with bash. For example wordpress_web_1.
docker exec -it wordpress_web_1 bashYou will need to enter the WordPress container and install a minimum of unix commands.
zipunzipmariadb-client
apt update && apt install -y mariadb-client zip unzipRun wp-backup.sh inside container.
./wp-backup.shThe author is not responsible for any loss of information or side effects. Use at your own risk.