Prepare and export data from a container-based environment
Jump to section
Prepare and assess the source environmentProcedureExport the source environmentProcedure
To help you find information quickly, we’ve remodeled the documentation to focus on how you work. Need help finding something?
Explore the updated navigation, use search, or get answers from Ask Red Hat.
Share Feedback to help us keep improving.
Prepare and export data from a container-based environment
Prepare and export data from your container-based Ansible Automation Platform deployment.
Export databases, secrets, and custom configurations from your source containerized Ansible Automation Platform deployment to create the migration artifact.
Perform database dumps of all components on the platform gateway node within the artifact created previously.
To run the psql and pg_restore commands, you must create a temporary container and run the commands inside of it. This command must be run from the database node.
This command assumes the image registry.redhat.io/rhel8/postgresql-15:latest. If you are missing the image, check the available images for the user with podman images ls.
The command above opens a shell inside the container named postgresql_restore_temp and has the artifact mounted into /var/lib/pgsql/backups. Also, this command is mounting the PostgreSQL certificates to ensure that you can resolve the correct certificates.
bash-4.4$ cd /var/lib/pgsql/backups
bash-4.4$ psql -h <pg_hostname> -U <component_pg_user> -d <database_name> -t -c 'SHOW server_version;' # ensure connectivity to db
bash-4.4$ pg_dump -h <pg_hostname> -U <component_pg_user> -d <component_pg_name> --clean --create -Fc -f <component>/<component>.pgc
bash-4.4$ ls -ld <component>/<component>.pgc
bash-4.4$ echo "<component>_pg_database: <database_name>" >> secrets.yml ## Add the DB name for the component to the secrets file
After collecting this data, exit from this temporary container.
Export the secrets from the containerized environment from one node of each component group.
For each step below, use the root user to run the commands.
Access the automation controller node and gather the secret key and add to the controller_secret_key value in secrets.yaml file.
Access the automation hub node and gather the database_fields.symmetric.key value and add to the hub_db_fields_encryption_key value in secrets.yaml file.
If any extra_settings exist in your containerized installation inventory, copy them into a new file and saving them under /tmp/backups/artifact/controller/custom_configs.
Package the artifact.
# cd /tmp/backups/artifact/
# [ -f sha256sum.txt ] && rm -f sha256sum.txt; find . -type f -name "*.pgc" -exec sha256sum {} \; >> sha256sum.txt
# cat sha256sum.txt
# cd ..
# tar cf artifact.tar artifact
# sha256sum artifact.tar > artifact.tar.sha256
# sha256sum --check artifact.tar.sha256
# tar tvf artifact.tar
We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.
Making open source more inclusive
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.
About Red Hat Documentation
We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.