AWX backup and restore not working.

ggiinnoo
Fri, 31 Oct 2025 09:29:34 +0000
Get Help

For a better part of 8 hours i have been trying to restore a backup i have to a new env.
The old env is a digital ocean setup and the new one a k3s single node.

The backup has been created with the following file:

---
apiVersion: awx.ansible.com/v1beta1
kind: AWXBackup
metadata:
  name: awxbackup-20250121
  namespace: awx
spec:
  deployment_name: awx-deployments

And after creating a temp pod and grabbing the backup i get 3 files:

 -rw-r--r--@   1 REDACTED  REDACTED       2662 Oct 10 08:42 awx_object
 -rw-r--r--@   1 REDACTED  REDACTED      18573 Oct 10 08:42 secrets.yml
 -rw-r--r--@   1 REDACTED  REDACTED  995910808 Oct 10 08:42 tower.db

which looks good!

New server

On the new server i created a operator kustomization.yml with the content:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - github.com/ansible/awx-operator/config/default?ref=2.9.0

# Set the image tags to match the git version from above
images:
  - name: quay.io/ansible/awx-operator
    newTag: 2.9.0

# Specify a custom namespace in which to install AWX
namespace: awx

And it spined up fine, no issues there.

I figured out you need a AWXbackup object on the new env, so i created it:

apiVersion: awx.ansible.com/v1beta1
kind: AWXBackup
metadata:
  name: awx-backup-migration
  namespace: awx
spec:
  deployment_name: awx-deployments

I also created AWXrestore object with:

apiVersion: awx.ansible.com/v1beta1
kind: AWXRestore
metadata:
  name: awx-backup-restore
  namespace: awx
spec:
  deployment_name: awx_deployments
  backup_name: awx-backup-migration
  no_log: false
  force_drop_db: true

i then noticed the operator log is spitting out error’s which cannot be viewed because no_log has been set , well no worries i might find something else i thought.. and yes..

I found in the docs you can use:

kubectl get awxbackup awx-backup-migration -o jsonpath="{.items[0].status.backupDirectory}"

to get a list of backups, so i thought i had the name wrong.. nope..
The output is empty:

root@k3s:~/awx-operator# kubectl get awxbackup awx-backup-migration -o jsonpath="{.items[0].status.backupDirectory}"
root@k3s:~/awx-operator#

AAH! i forget to place the data in the correct location? No. I created a temp pod:

apiVersion: v1
kind: Pod
metadata:
  name: awx-backup-restore
  namespace: awx
spec:
  containers:
  - name: restore-container
    image: busybox:latest
    command: ["/bin/sh", "-c", "sleep 3600"]
    volumeMounts:
    - mountPath: /backups
      name: awx-backup-pvc
  volumes:
  - name: awx-backup-pvc
    persistentVolumeClaim:
      claimName: awx-deployments-backup-claim

i get into it:

kubectl exec -it awx-backup-restore -n awx -- /bin/sh

And behold, in the folder /backups/ there is a folder called awx-backup-migration with the 3 files i mentioned above.

It’s really strange that i do not see the backup with the command mentioned earlier.
I hope someone can tell me what i am doing wrong.

2 posts - 2 participants