Need advices on AWX config import/export


When I first setup awx-operator and awx 7 months ago, I used to deal with Helm charts, awx-operator that deployed an awx instance.

I used to configured my AWX instance using an ansible playbook I made that set all settings i need (i.e. LDAP, organization, projects, templates etc…)

Now, i plan to upgrade my current AWX setup :

  • awx-operator from 2.9.0 to 2.19.0
  • awx from 23.5.1 from to 24.6.0

Upgrade will be done still using Helm charts but I got several questions as it’s the first time I’ll do that :

  • if everything runs fine, does my AWX data should be kept as-is or will it be replaced as it was a new instance ?
  • from a configuration perspective, I know how to perform configuration through ansible-playbook, but is there any way to dump current AWX configuration I could use in case of failure ?
  • I saw awx cli is able to export settings in json, is it the best way to dump all my AWX data in case of failures ?

Thanks a lot for your precious advices.

  1. They run database migrations as part of the upgrade process. The migrations can take a while. You could try to review the release notes and see if theres any breaking changes. If the migrations fail, you will need to investigate and either fix the issue manually or roll back. If it works then the data will be maintained
  2. All configuration data is stored in the database. If you save a backup of the database you should be ok for rollback. awx-cli also has the export/import commands which might be better for the upgrade process. I would still backup the database in case.
    Usage Examples — AWX CLI Ansible Tower 3.8.6 documentation
  3. Backup the db and use the cli export to be safe. I would try to export/import using the cli before starting the upgrade so you know how it works
1 Like

Hi @mikemorency thanks for your answers.

I already get a .json from awx-cli that’s a good start.
When you say “backup the db” it means from a Kubernetes perspective that you backup your PV right ? (note : i’m a beginner with K8s)

Yes, ive only ever used dedicated DBs so I cant give you exact steps. But that sounds right, just the PV matters.

AWX uses a postgres db, so you can also connect to the db and do a pg_dump and then later a pg_restore. Thats usually what I do. Either way id recommend testing the backup if you can before you do the upgrade

1 Like

pg_dump/restore is a great idea.

Thanks a lot for your help, it helps me to secure my setup before upgrading :slight_smile:
Fingercross !


In addition, for newbies like me who need to perform a dump from embedded Postgre DB, the easiest way is :

Create a temporary port-forward between AWX postgre DB and your computer with :

  1. Get information about Postgre DB with :
# retrieve your secret's name, something like awx-postgres-configuration
kubectl get secrets

# show secrets 
kubectl get secrets awx-your-instance-postgres-configuration -o yaml
  1. Decode with a base64 decoder the following datas ( ’ | base64’ if you use Linux, else use an online decoder)
  database: xxxxx
  host: xxxxx
  password: xxxxx
  port: xxxxx
  type: xxxx
  username: xxxx
  1. Create a temporary port-forward between your postgre pod and your computer
kubectl port-forward awx-your-postgre-pod 5432:5432
  1. Finally, you can access the DB with any tools you got, in my case DBeaver, then perform a Backup.