Download the PHP package atomicsmash/backups without Composer
On this page you can find all versions of the php package atomicsmash/backups. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download atomicsmash/backups
More information about atomicsmash/backups
Files in atomicsmash/backups
Package backups
Short Description Backups
License MIT
Homepage http://www.atomicsmash.co.uk/
Informations about the package backups
This plugin is for backing up a WordPress website to Amazon S3.
Plugin features
- Database backup
- Saves a local database dump with an obscure file name.
- Syncs local database with S3.
- Removes local copy to reduce wasted HDD space.
- Local development databases can be synced as well.
- Media library backup
- Two way sync of uploads folder and Amazon S3.
- This can be used for backing up live websites but also for syncing local development assets between developers.
- Offload S3 integration - Coming soon
- After media has been moving transferred, you can save the local meta data required for offload S3 to starting loading assets from S3.
Functions
wp backups backup
This function syncs media, performs a DB backup and sync the database to S3.
Examples
wp backups backup
- backup media and database
wp backups backup --type=media
- This just syncs your media
wp backups backup --type=database
- Use this to dump the DB and sync with S3
wp backups development_sql_sync
Examples
wp backups development_sql_sync
- This checks the status of the remote development database
wp backups development_sql_sync --sync-direction=push
- This checks the status of the remote development database
- Then provides the option to overwrite the remote database with what is available locally
wp backups development_sql_sync --sync-direction=pull
- This checks the status of the remote development database
- Then provides the option to overwrite the local database with what is available on S3
Installation
1. Add the Wordpress plugin to your composer file by navigating to your project and running this inside a terminal:
Commit the changes to your local composer file.
2. Add your S3 credentials to your wp-config file.
And these constants to your wp-config file:
You can obtain these details by creating an IAM user. Here is our guide on how to setup an IAM Amazon user and get the access and secret key that you need.
If you know the name of the bucket you would like to sync with, you can hard this by adding:
Commit the changes to your config.
3. Activate 'Backups'
Now activate the plugin on whichever site you would like backup. This can be done via the admin interface, or by running:
If you want to backup a live website, chances are you will need to SSH into the server.
4. Test S3 connection:
To test the connection to S3 run:
If there is an issue, please check your credentials are being loaded and are correct.
5. If the check is successful, it's time to create a fresh bucket
bucket_name
is usually the address of the site you are currently working on ('website.local'). For example:
Running the above command will ask the question: Create bucket? [y/n]
- supply 'y' to continue.
This will then create a bucket called "mywebsite.co.uk.backup" and select it ready for use.
6. Perform a backup
To start the first backup manually,
7. Setup auto-deletion of SQL files
Depending on how often you backup your website, the SQL files will start to build up quickly. You can setup an S3 folder lifecycle to auto-delete files older than X number of days.
We usually usually retain backups for 30 days, so we would run:
8. Setting up auto-backup (cron job)
To get the backup command to run on a regular basis, you need to setup a cron job. Use something similar to this:
If you are using composer in your project then your WordPress core files might be inside a subfolder, please modify the path to reflect this. The cron job would look like this:
If you are using forge, then simply add to the server scheduling panel:
Also, if you are using Capistrano, don't forget to add current
to the
Troubleshooting
Are you receiving an error similar to PHP Fatal error: Uncaught Error: Class 'Aws\S3\S3Client' not found in /path/to/file
Make sure you are requiring your autoload.php generated by composer. We usually add this to the top of our wp-config file:
Upcoming featured
- Backup stats
- Added 'restore' functionality
Changelog
= 0.1.2 =
- Added more exceptions for downloading data/development sql files
= 0.1.1 =
- Added exception for downloading data/development sql files
= 0.1.0 =
- Added local development database backups
- Added better plugin development detection by looking for the existence of an vendor/autoload.php file
- There is a new BACKUPS_S3_BUCKET constant to hard code the preferred bucket
= 0.0.5 =
- Updated readme
= 0.0.4 =
- Improved UX when creating a bucket
- FIXED issue with syncing DB backups back to local machine from S3
= 0.0.3 =
- Added offload S3 functionality
- Added setup guide
- Added lifecycle addition for SQL folder
= 0.0.2 =
- Simplified media transferring
= 0.0.1 =
- Project renamed from log-flume to 'Backups'
- Added database backup functionality