Backup WordPress database during Trellis deploys.
- Trellis 9dfddfd or later
- Ansible v2.4 or later
Add this role to galaxy.yml
:
# galaxy.yml
- name: trellis-backup-during-deploy
src: https://github.com/ItinerisLtd/trellis-backup-during-deploy
version: 0.1.2 # Check for latest version!
Add this role to the deploy_initialize_after
hook:
# group_vars/all/deploy-hooks.yml
# Learn more on https://roots.io/trellis/docs/deploys/#hooks
deploy_initialize_after:
- "{{ playbook_dir }}/vendor/roles/trellis-backup-during-deploy/tasks/main.yml"
Deploy as usual. No special action needed.
$ wp db export
is invoked during deploy. You can find the database dump in /srv/www/example.com/releases/2018XXXXXXXXXX/example_com_env-2018-XX-XX-XXXXXXX.sql
– be sure to check the pre-latest release
-folder (e.g. the release before deploy) since current
serves as alias to the latest release.
trellis-backup-during-deploy is a Itineris Limited project created by Tang Rufus.
Special thanks to the Roots team whose Trellis make this project possible.
Full list of contributors can be found here.
Please provide feedback! We want to make this library useful in as many projects as possible. Please submit an issue and point out what you do and don't like, or fork the project and make suggestions. No issue is too small.
Please see CHANGELOG for more information on what has changed recently.
trellis-backup-during-deploy is released under the MIT License.