# Is there any way to restore your site from backup in the terminal?

**URL:** <https://meta.discourse.org/t/is-there-any-way-to-restore-your-site-from-backup-in-the-terminal/42377>\
**Category:** Support\
**Created:** [2016 年4 月 11 日 06:31 UTC](https://meta.discourse.org/t/is-there-any-way-to-restore-your-site-from-backup-in-the-terminal/42377 "2016-04-11T06:31:25Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

作者： ![Eric\_Keller](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eric_keller/32/517693_2.png) [@Eric\_Keller](https://meta.discourse.org/u/Eric_Keller)\
发布日期： [2017 年10 月 16 日 16:37 UTC](https://meta.discourse.org/t/is-there-any-way-to-restore-your-site-from-backup-in-the-terminal/42377/10 "2017-10-16T16:37:25Z")

</div>

restoring from a app.yml and an external tar.gz file was mixing up some of the items I found along this thread:

```
TARBALL_PATH=$(ls local/backups/-*.tar.gz | tail -n 1)
TARBALL_NAME=$(basename ${TARBALL_PATH})
cat ${TARBALL_PATH} | docker exec -i app sh -c "cat - > /var/www/discourse/public/backups/default/${TARBALL_NAME}"
docker exec -i app sh -x << EOF
discourse enable_restore
discourse restore ${TARBALL_NAME}
discourse disable_restore
EOF

```

I had several pitfalls:

1. the tarball to restore has to be placed exactly in `/var/www/discourse/public/backups/default/`
2. the `/var/www/discourse/script/discourse restore tarball-name` did not work due to some single sign-on known issue
3. the version of thor installed by `gem install thor` was too recent and then incompatible with the rest.
4. finally one of the tarball I tried to restore from did not contain the “meta.json” file…

Hope this helps other in their restore journey.

---

_[View the full topic](https://meta.discourse.org/t/is-there-any-way-to-restore-your-site-from-backup-in-the-terminal/42377)._
