# Upgrade from previous version - retaining data?

**URL:** <https://forum.ansible.com/t/upgrade-from-previous-version-retaining-data/32027>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [January 22, 2020, 4:58pm UTC](https://forum.ansible.com/t/upgrade-from-previous-version-retaining-data/32027 "2020-01-22T16:58:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [January 22, 2020, 4:58pm UTC](https://forum.ansible.com/t/upgrade-from-previous-version-retaining-data/32027/1 "2020-01-22T16:58:16Z")

</div>

Can anyone tell me if this process is supposed to upgrade and retain data or just simply do an upgrade (data loss)? I’m going to assume it doesn’t consist of retaining data as when I followed the process my data was gone, but I’d like to confirm. If no data is retained is there a preferred process to retain the data using AWX?

[https://github.com/ansible/awx/blob/devel/INSTALL.md#upgrading-from-previous-versions](https://github.com/ansible/awx/blob/devel/INSTALL.md#upgrading-from-previous-versions)

## Upgrading from previous versions

Upgrading AWX involves rerunning the install playbook. Download a newer release from [https://github.com/ansible/awx/releases](https://github.com/ansible/awx/releases) and re-populate the inventory file with your customized variables.

For convenience, you can create a file called `vars.yml`:

```auto
admin_password: 'adminpass'
pg_password: 'pgpass'
rabbitmq_password: 'rabbitpass'
secret_key: 'mysupersecret'

```

And pass it to the installer:

```auto
$ ansible-playbook -i inventory install.yml -e @vars.yml

Thanks 

```

---

<div class="post-metadata">

**Author:** ![Nuno\_Jordao](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Nuno\_Jordao](https://forum.ansible.com/u/Nuno_Jordao)\
**Post date:** [January 24, 2020, 11:13pm UTC](https://forum.ansible.com/t/upgrade-from-previous-version-retaining-data/32027/2 "2020-01-24T23:13:34Z")

</div>

Hello,

I have been upgrading my production AWX from version 3.01 to 9.1.0 without any data loss. I am using an external database and I carefully update the inventory variables with each version change with my values.  
The new versions simply apply the django database migrations without deleting anything. Others have reported otherwise. YMMV.

Regards.

---

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [January 24, 2020, 11:56pm UTC](https://forum.ansible.com/t/upgrade-from-previous-version-retaining-data/32027/3 "2020-01-24T23:56:01Z")

</div>

But is the process mentioned supposed to retain data when using the database provided by the Docker install process? I’m not using an external database.

---

<div class="post-metadata">

**Author:** ![Nuno\_Jordao](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Nuno\_Jordao](https://forum.ansible.com/u/Nuno_Jordao)\
**Post date:** [January 25, 2020, 12:04am UTC](https://forum.ansible.com/t/upgrade-from-previous-version-retaining-data/32027/4 "2020-01-25T00:04:34Z")

</div>

Hello,

I think so, but be careful because the local database configurations in the inventory change between versions (data dir and postgres admin user I think) and it tries to upgrade to postgres 10 at some point. AWX version 8? [https://github.com/ansible/awx/issues/5214](https://github.com/ansible/awx/issues/5214)

Regards.

---

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [January 27, 2020, 9:01pm UTC](https://forum.ansible.com/t/upgrade-from-previous-version-retaining-data/32027/5 "2020-01-27T21:01:28Z")

</div>

Just as an FYI, unless I’m doing something wrong but the upgrade process seems to not retain data when using Docker and not outside database other then what AWX provides through the docker install process.

I’ve now upgrade from 7.0.0 to 8.0.0 and lost all data  
Upgraded from 8.0.0 recreated orgs, teams etc upgrade to 9.0.0 and lost all data  
Upgrade from 9.0.0 recreated orgs, teams etc to 9.0.1 and lost all data.

My guess from what I’ve read is the AWX install as is does not retain data. Is there anyone that can confirm this that isn’t using a external database?

Thanks

---

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [January 27, 2020, 9:13pm UTC](https://forum.ansible.com/t/upgrade-from-previous-version-retaining-data/32027/6 "2020-01-27T21:13:07Z")

</div>

These are the steps I’ve performed in-between each version.

1. cd /awx (currently 7.0.0)

2. get fetch

3. get checkout tags/8.0.0

4. git pull

5. cd /awx/installer

6. create vars.yml

7. update inventory file for previous (docker\_compose\_dir, postgres\_data\_dir) etc

8. run the installer

9. When logging in, I seen the whole upgrading AWX page refreshing

10. Log in

11. No longer have previous data etc. All data is gone. Its like its a new install, but the passwords from the previous install still work etc.
