How to restore Templates and Projects ?

255 views
Skip to first unread message

Vi Kan

unread,
Aug 28, 2018, 7:54:29 AM8/28/18
to AWX Project
Hi!

Unfortunately, I ran into problem with upgrading awx to 1.0.7. I had tried to update existing awx. Now my instance doesn't work. Than I made a dump of awx database, made fresh install and imported it. Now I can login to my instance and all my settings exist here except Templates and Projects. I use docker installation method with external project_data_dir so my projects are present in container. Is there any way to restore them into awx?

P.S. I've tried to get objects via tower-cli but without any luck.

Soniya panwar

unread,
Apr 29, 2019, 2:47:03 AM4/29/19
to AWX Project
Hello Kan,

AWX does not provide any integrated solution to perform backup and restore and therefore the upgrades and migrations can only be performed as a fresh installation. In AWX there does exist a workaround, which involves copying the PostgreSQL data directory and using the same with a fresh installation to restore the backup. 

In order to implement the workaround we need to perform following steps:

1. Stop the PostgreSQL docker container and copy the content of /var/lib/pgdocker directory on awx node to the same directory on awx-2 node:
    $ docker stop <container_id>
    $ scp -r ./pgdocker awx-2:/var/lib/

2. Edit inventory file in installer directory on awx-2 node and provide the location of pgdocker directory in postgres_data_dir variable:
    Set value of "postgres_data_dir" in inventory file
    $ vi inventory 
       postgres_data_dir = </var/lib/pgdocker>

3. Install AWX as a fresh installation in awx-2 node using the modified inventory file:
    $ ansible-playbook -i inventory install.yml –vv

4. The backed up content of awx will be visible on awx-2 dashboard. 

Thanks 
Soniya

Ankit Vashistha

unread,
Apr 29, 2019, 2:52:15 AM4/29/19
to Soniya panwar, AWX Project
Are you sure this will work if the versions are different for both AWX setups?

Regards,
Ankit


--
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 post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/b4a76a9f-b20d-489a-9ff4-cc382f7a626c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wei-Yen Tan

unread,
Apr 29, 2019, 4:39:25 AM4/29/19
to Ankit Vashistha, AWX Project, Soniya panwar
If I am not mistaken the preferred way to upgrade is to use tower-cli to do an export. Wipe the containers. Reinstall the containers and then reimport through tower-cli. Note credentials and job history is not backed up. 

The reason why this is because the team may make sudden changes to database tables and such. Exporting through towsr-cli allows you to preserve this albiet those two things. 

Soniya panwar

unread,
May 2, 2019, 6:10:10 AM5/2/19
to AWX Project
Hello Wei-Yen Tan,

Yes, there are two options available to perform data migration from the old AWX instance to the new upgraded AWX instance:
1. Making use of tower-cli send/receive feature as described in following  link: https://github.com/ansible/awx/blob/devel/DATA_MIGRATION.md . Please note, this option  would not migrate system settings, scheduled jobs and permissions. These are to be migrated manually.
2. Taking a backup of the directory where the PostgreSQL DB is stored and doing a fresh installation after setting postgres_data_dir parameter in inventory file. However, please note this option would not perform the backup of venv variables and configuration files of AWX. 

Thanks 
Soniya
To unsubscribe from this group and stop receiving emails from it, send an email to awx-p...@googlegroups.com.

To post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/b4a76a9f-b20d-489a-9ff4-cc382f7a626c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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-p...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages