Ansible playbook for Trellis that manages database and uploads migration. Inspired by hamedb89/trellis-db-push-and-pull.
CHANGELOG-TRELLIS-DATABASE-UPLOADS-MIGRATION.md
file into Trellis root folder (so you can always know the version of the tool you are using)*.yml
files into Trellis root folderbin/*.sh
files into Trellis bin folderdatabase_backup/*
to the end of the Bedrock .gitignore
filelocal_path
parameter in wordpress_sites.yml
database_backup
folder inside Bedrock will be automatically created if doesn't existgit
operations while running ./bin/database.sh
command, this because the tool uses the Bedrock folder as temp folder to store database dump before importing/exporting it and then delete it.canonical
from variables url_from
and url_to
in the files database-pull.yml
and database-push.yml
./bin/uploads.sh <environment> <site name> <mode>
./bin/database.sh <environment> <site name> <mode>
<mode>
options for uploads task: push
, pull
<mode>
options for database task: push
, pull
, backup
push
is for sending to the selected environment and the pull
for receiving from itbackup
is for backup the database of the selected environment[development]
development_host ansible_host=192.168.50.5 ansible_connection=ssh ansible_user=vagrant ansible_ssh_private_key_file=.vagrant/machines/default/virtualbox/private_key ansible_ssh_extra_args="-o StrictHostKeyChecking=no -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ForwardAgent=yes"
[web]
development_host ansible_host=192.168.50.5 ansible_connection=ssh ansible_user=vagrant ansible_ssh_private_key_file=.vagrant/machines/default/virtualbox/private_key ansible_ssh_extra_args="-o StrictHostKeyChecking=no -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ForwardAgent=yes"
[staging]
staging_host ansible_host=your_server_hostname
[web]
staging_host ansible_host=your_server_hostname
[production]
production_host ansible_host=your_server_hostname
[web]
production_host ansible_host=your_server_hostname
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)