2.5 KiB
Migrating Data from Local Docker
If you are migrating data from a Local Docker installation (17.0.1 and prior), you can migrate your data to the development environment via the migrate.yml playbook, or by using the manual steps described below.
Note: This will also convert your postgresql bind-mount into a docker volume.
First, in the inventory file, set your pg_password, broadcast_websocket_secret, secret_key, and any other settings you need for your deployment. Make sure you use the same secret key value you had with your previous Local Docker deployment.
Migrate data with migrate.yml
If you had a custom pgdocker or awxcompose location, you will need to set the postgres_data_dir and old_docker_compose_dir variables.
- Run the migrate playbook to migrate your data to the new postgresql container and convert the data directory to a volume mount.
$ ansible-playbook -i tools/docker-compose/inventory tools/docker-compose/migrate.yml -e "migrate_local_docker=true" -e "postgres_data_dir=~/.awx/pgdocker" -e "old_docker_compose_dir=~/.awx/awxcompose"
- Change directory to the top of your awx checkout and start your containers
$ make docker-compose
- After ensuring your data has been successfully migrated, you may delete your old data directory (typically stored at
~/.awx/pgdocker).
Migrating data manually
- With Local Docker still running, perform a pg_dumpall:
Note: If Local Docker is no longer running
docker-compose -f ~/.awx/awxcompose/docker-compose.yml up postgres
$ docker-compose -f ~/.awx/awxcompose/docker-compose.yml exec postgres pg_dumpall -U awx > awx_dump.sql
- Remove all local docker containers (specifically awx_postgres)
$ docker -f rm awx_postgres
- Template the new docker-compose.yml
$ ansible-playbook -i tools/ansible/inventory tools/ansible/sources.yml
- Start a container with a volume (using the new tools/docker-compose/_sources/docker-compose.yml)
$ docker-compose -f ../docker-compose/_sources/docker-compose.yml up postgres
- Restore to new
awx_postgres
$ docker-compose -f ../docker-compose/_sources/docker-compose.yml exec -T postgres psql -U awx -d awx -p 5432 < awx_dump.sql
- Run the docker-compose.yml to start the containers
$ docker-compose -f ../docker-compose/_sources/docker-compose.yml up task
- Check to ensure your data migration was successful, then you can delete your the
awx_dump.sqlbackup and your old data directory.