--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/e5153845-36e6-4516-9d95-850a45b701b5n%40googlegroups.com.
According to what you indicate:
docker ps <--find the postgresql container name
Check mount points:
docker inspect %postgresql-container-name%
And find the Mounts section:
"Mounts": [
{
"Type": "bind",
"Source": "/app/.awx/pgdocker/10/data",
"Destination": "/var/lib/postgresql/data",
Connect to posgresql container
docker exec -it %postgresql-container-name% /bin/bash
1.3 Check DB name:
psql -U awx
\l
1.4 Create backup for the DB from previous step
From shell:
cd /var/lib/posgtgresql/data/
pg_dump -U awx > backup.sql
2. Find the secret_key data from old setup
In docker compose it could be /app/.awx/awxcompose/SECRET_KEY
3. Change the settings in awx.yaml
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
name: awx
spec:
service_type: nodeport
nodeport_port: 30080
secret_key_secret: custom-awx-secret-key
---
apiVersion: v1
kind: Secret
metadata:
name: custom-awx-secret-key
namespace: awx
stringData:
secret_key: <KEY FROM OLD SECRET_KEY>
type: Opaque
3. Deploy the AWX
4. Compare the SECRET_KEY info in the pod awx-web
kubectl get pods
kubectl exec -it awx-%podname% -c awx-web /bin/bash
cat /etc/tower/SECRET_KEY
5. Scale awx operator and awx deployment to 0 execute the commands
kubectl scale deployment awx-operator-controller-manager --replicas=0
kubectl scale deployment awx --replicas=0
6. Copy the backup file from old system to the new system (in my case I use SCP). Backup file should be at /app/.awx/pgdocker/10/data on the old system
7. Find the mount point for minikube setup:
docker inspect minikube
Find the Mounts section:
"Mounts": [
"Source": "/var/lib/docker/volumes/minikube/_data",
And copy the backup file to /var/lib/docker/volumes/minikube/_data/hostpath-provisioner/awx/postgres-13-awx-postgres-13-0/data
8. Connect do postgresql-pod (you can find the DB pod name with kubectl get pods command)
kubectl exec -it awx-postgres-13-0 bash -n=awx
9. Drop old database
psql -U awx -d posgres
Check DBs list
\l
DROP DATABASE awx;
Create new DB
CREATE DATABASE awx
10. Restore the backup form shell
psql -U awx < backup.sql
And check DB structure (amount of tables and etc):
Psql -U awx
\d
11. Scale deployments back
kubectl scale deployment awx-operator-controller-manager --replicas=1
kubectl scale deployment awx --replicas=1
12. Check logs in awx-web container
kubectl logs -f awx-%podname% -c awx-web -n=awx
13. Check application, job history and etc.
If you have any Q about these instruction - ask :)
I've found how to resolve this.
When it's frozen in this state, just run "awx-manage migrate --noinput".
Since the database has already been restored by the pgsql cli, all data is available.