# How to Restore DB from backup file

**URL:** <https://forum.ansible.com/t/how-to-restore-db-from-backup-file/29880>\
**Category:** Ansible Project\
**Created:** [March 14, 2019, 2:12am UTC](https://forum.ansible.com/t/how-to-restore-db-from-backup-file/29880 "2019-03-14T02:12:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sindhuja\_Koneru](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@Sindhuja\_Koneru](https://forum.ansible.com/u/Sindhuja_Koneru)\
**Post date:** [March 14, 2019, 2:12am UTC](https://forum.ansible.com/t/how-to-restore-db-from-backup-file/29880/1 "2019-03-14T02:12:22Z")

</div>

Hello,

Can someone please help me here, not able to figure out why i am unable to run restore.yml that is provided in the bundle.

STEP 1:- I have run backup.yml and it successfully created a tar file.  
STEP 2:- Then I am trying to run restore.yml and have given the full path of the file created from STEP1 (/location/Tarfilename.tar.gz) but it throws following error.

can someone please assist me?

ASK [restore : Write SECRET\_KEY into /etc/\*\*\*\*\*/] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

changed: [[tnode1.runitdif.bankofamerica.com](http://tnode1.runitdif.bankofamerica.com/)]

changed: [[tnode3.XYZ.com](http://tnode3.xyz.com/)]

changed: [[tnode2.XYZ.com](http://tnode2.xyz.com/)]

TASK [restore : Dump the new Tower instance topology] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

skipping: [[tnode2.XYZ.com](http://tnode2.xyz.com/)]

skipping: [[tnode3.XYZ.com](http://tnode3.xyz.com/)]

changed: [[tnode1.XYZ.com](http://tnode1.xyz.com/)]

TASK [restore : Perform a PostgreSQL restore (external).] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

skipping: [[tnode2.XYZ.com](http://tnode2.xyz.com/)]

skipping: [[tnode3.XYZ.com](http://tnode3.xyz.com/)]

fatal: [[tnode1.XYZ.com](http://tnode1.xyz.com/)]: FAILED! =\> {“censored”: “the output has been hidden due to the fact that ‘no\_log: true’ was specified for this result”, “changed”: true}

[[tnode1.XYZ.com](http://tnode1.xyz.com/)] TASK: restore : Perform a PostgreSQL restore (external). (debug)\>

[[tnode1.XYZ.com](http://tnode1.xyz.com/)] TASK: restore : Perform a PostgreSQL restore (external). (debug)\>

[[tnode1.XYZ.com](http://tnode1.xyz.com/)] TASK: restore : Perform a PostgreSQL restore (external). (debug)\>

[[tnode1.XYZ.com](http://tnode1.xyz.com/)] TASK: restore : Perform a PostgreSQL restore (external). (debug)\>

---

<div class="post-metadata">

**Author:** ![Ankit2](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@Ankit2](https://forum.ansible.com/u/Ankit2)\
**Post date:** [March 14, 2019, 3:03am UTC](https://forum.ansible.com/t/how-to-restore-db-from-backup-file/29880/2 "2019-03-14T03:03:11Z")

</div>

Try removing no\_log from the playbook which is giving error to see what exact error it gives. It might have sensitive data hence it is censored.

---

<div class="post-metadata">

**Author:** ![Gaetano\_Giacalone](https://avatars.discourse-cdn.com/v4/letter/g/e56c9b/32.png) [@Gaetano\_Giacalone](https://forum.ansible.com/u/Gaetano_Giacalone)\
**Post date:** [March 14, 2019, 3:15am UTC](https://forum.ansible.com/t/how-to-restore-db-from-backup-file/29880/3 "2019-03-14T03:15:32Z")

</div>

Not sure what you are using to extract your tarball but here is an excerpt from my role extracting a tarball after downloading it from the internet

- name: Downloading Apache APR sources  
get\_url:  
url: “{{ apr\_tarball\_url }}”  
dest: “/tmp/{{ apr\_version }}.tar.gz”  
register: apr\_source

- debug:  
var: apr\_source

- name: Unpacking Apache APR  
unarchive:  
copy: no  
dest: /tmp/  
src: “{{ apr\_source.dest }}”  
when: apr\_source.changed  
register: apr\_source\_unpack

- debug:  
var: apr\_source\_unpack

I am also registering some variables to check if the tarball has changed not sure how much use for you.
