# Reset Postgres DB to default

**URL:** <https://forum.ansible.com/t/reset-postgres-db-to-default/30746>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [July 10, 2019, 3:34pm UTC](https://forum.ansible.com/t/reset-postgres-db-to-default/30746 "2019-07-10T15:34:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamroddo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iamroddo/32/321_2.png) [@iamroddo](https://forum.ansible.com/u/iamroddo)\
**Post date:** [July 10, 2019, 3:34pm UTC](https://forum.ansible.com/t/reset-postgres-db-to-default/30746/1 "2019-07-10T15:34:12Z")

</div>

Is there a mechanism to reset the Postgres DB to the state straight after the installation of AWX? The use case is to do a ‘factory reset’ of AWX without deleting and reinstalling from scratch.

---

<div class="post-metadata">

**Author:** ![shivharsh.nec](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@shivharsh.nec](https://forum.ansible.com/u/shivharsh.nec)\
**Post date:** [July 11, 2019, 8:49am UTC](https://forum.ansible.com/t/reset-postgres-db-to-default/30746/2 "2019-07-11T08:49:18Z")

</div>

Hi,

There is no inbuilt mechanism to factory reset AWX other than deleting and reinstalling from scratch. However, you may still work your way around the requirement using below mentioned steps:

Please note: In order for the below workaround to work, you would need to maintain a backup of “ **pgdocker** ” directory created under postgres\_data\_dir path after the fresh installation and successful migration [**migrations\_notran**]. **postgres\_data\_dir** path is configured in AWX/installer/inventory file.

`[root@oss-awx-02 installer]# cat inventory |grep pgdocker postgres_data_dir=/tmp/pgdocker`

**_Workaround Steps:_**

- Stop all the docker containers.

`[root@oss-awx-01 installer]# docker stop awx_task awx_web memcached rabbitmq postgres`

- Delete pgdocker directory.

`  
[root@oss-awx-01 installer]# rm -rf /tmp/pgdocker

`

- Copy the backed up pgdocker to the postgres\_data\_dir path.

`  
[root@oss-awx-02 installer]# scp -r /tmp/pgdocker root@oss-awx-01:/tmp/

`

- Start all the docker containers.

`[root@oss-awx-01 installer]# docker start awx_task awx_web memcached rabbitmq postgres`

Hope this is helpful !

Thanks,  
Shivharsh
