The ability to backup and restore your system(s) has been integrated into the Tower setup playbook. Refer to Backup and Restore for Clustered Environments for additional considerations.
Note
When restoring, always use the most recent minor version of a release to backup and be sure to restore to the same version from which it was backed up.
The Tower setup playbook is invoked as setup.sh
from the path where you unpacked the Tower installer tarball. It uses the same inventory file used by the install playbook. The setup script takes the following arguments for backing up and restoring:
-b
Perform a database backup rather than an installation.-r
Perform a database restore rather than an installation.As the root user, call setup.sh
with the appropriate parameters and Tower backup or restored as configured.
root@localhost:~# ./setup.sh -b
root@localhost:~# ./setup.sh -r
A default restore path is used unless EXTRA_VARS
are provided with a non-default path, as shown in the example below:
root@localhost:~# ./setup.sh -e 'restore_backup_file=/path/to/nondefault/backup.tar.gz' -r
Optionally, you can override the inventory file used by passing it as an argument to the setup script:
setup.py -i <inventory file>
In addition to the install.yml
file included with your setup.sh
setup playbook, there are also backup.yml
and restore.yml
files for your backup and restoration needs.
These playbooks serve two functions–backup and restore.
SECRET_KEY
fileWhen restoring your system, Tower checks to see that the backup file exists before beginning the restoration. If the backup file is not available, your restoration will fail.
Note
Ensure your Tower host(s) are properly set up with SSH keys or user/pass variables in the hosts file, and that the user has sudo access.
sudo
access, depending on how credentials were setup. On remote systems, you may need different credentials to grant you access to the remote system you are trying to backup or restore.setup.sh
to do a restore from the default restore file path, /var/lib/awx
, -r
is still required in order to do the restore, but it no longer accepts an argument. If a non-default restore file path is needed, the user must provide this as an extra var (root@localhost:~# ./setup.sh -e 'restore_backup_file=/path/to/nondefault/backup.tar.gz' -r
).setup.sh
installer, the restore playbook will automatically locate the restore files. In this case, you do not need to use the restore_backup_file
extra var to specify the location of the backup file.The procedure for backup and restore for a clustered environment is similar to a single install, except with some considerations described in this section.
When restoring to an existing cluster, the restore contains:
/etc/tower
)When restoring a backup to a separate instance or cluster, host-specific configuration (including manual projects, job output, and custom settings under /etc/tower
) is not restored to any hosts in the new environment.
The restore process will not alter instance groups present before the restore (neither will it introduce any new instance groups). Restored Tower resources that were associated to instance groups will likely need to be reassigned to instance groups present on the new Tower cluster.