# How to restore a backup of an older version to a fresh install?

**URL:** <https://meta.discourse.org/t/how-to-restore-a-backup-of-an-older-version-to-a-fresh-install/50881>\
**Category:** Self-hosting\
**Created:** [2016年九月29日 20:19 UTC](https://meta.discourse.org/t/how-to-restore-a-backup-of-an-older-version-to-a-fresh-install/50881 "2016-09-29T20:19:01Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![zachwlewis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zachwlewis/32/105371_2.png) [@zachwlewis](https://meta.discourse.org/u/zachwlewis)\
**Post date:** [2016年九月29日 20:19 UTC](https://meta.discourse.org/t/how-to-restore-a-backup-of-an-older-version-to-a-fresh-install/50881/1 "2016-09-29T20:19:02Z")

</div>

Continuing the discussion from [Docker rebuild failed updating Postgresql: Signature verification failed](https://meta.discourse.org/t/docker-rebuild-failed-updating-postgresql-signature-verification-failed/50759/10):

After following the steps on the Discourse update page, I was asked to update _via_ the command line. When updating _via_ the command line, I was asked to update my `app.yml`, and the update essentially attempted to downgrade my postgresql install, resulting in all my data being lost. Luckily, I have several backups in an S3 bucket.

After a bit of work, my Discourse install was running, but it was a totally fresh copy. I pointed the backups directory to the S3 bucket, but was unable to see any of my old backups. To test that everything was configured correctly, I ran a manual backup, which appeared both in my Discourse Backups page and in the S3 bucket (alongside the previous backups).

I made very sure to keep lots of backups in case I somehow lost all my data. How can I restore from these backups?

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2016年九月29日 20:22 UTC](https://meta.discourse.org/t/how-to-restore-a-backup-of-an-older-version-to-a-fresh-install/50881/2 "2016-09-29T20:22:02Z")

</div>

1. Go to /admin/backups and upload a backup there.

2. Enable the setting `allow restore`

3. Click on restore in /admin/backups

---

<div class="post-metadata">

**Author:** ![zachwlewis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zachwlewis/32/105371_2.png) [@zachwlewis](https://meta.discourse.org/u/zachwlewis)\
**Post date:** [2016年九月29日 20:28 UTC](https://meta.discourse.org/t/how-to-restore-a-backup-of-an-older-version-to-a-fresh-install/50881/3 "2016-09-29T20:28:02Z")

</div>

@Falco Thanks for the quick response.

So, I’m attempting to log in to the site, and it says I’m not allowed to log in because it’s in read-only mode. I specifically set the site to read-only mode until I was able to restore the data. How do I log in?

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2016年九月29日 20:29 UTC](https://meta.discourse.org/t/how-to-restore-a-backup-of-an-older-version-to-a-fresh-install/50881/4 "2016-09-29T20:29:23Z")

</div>

Do `/users/admin-login` work?

---

<div class="post-metadata">

**Author:** ![zachwlewis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zachwlewis/32/105371_2.png) [@zachwlewis](https://meta.discourse.org/u/zachwlewis)\
**Post date:** [2016年九月29日 20:31 UTC](https://meta.discourse.org/t/how-to-restore-a-backup-of-an-older-version-to-a-fresh-install/50881/5 "2016-09-29T20:31:28Z")

</div>

After entering my email, it went to a white page with the following text:

```plaintext
{"errors":["The site is in read only mode. Interactions are disabled."],"error_type":"read_only"}

```

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2016年九月29日 20:33 UTC](https://meta.discourse.org/t/how-to-restore-a-backup-of-an-older-version-to-a-fresh-install/50881/6 "2016-09-29T20:33:07Z")

</div>

Ok.

SSH to the server, and then:

```plaintext
cd /var/discourse
./launcher enter app
rails c
Discourse.disable_readonly_mode

```

---

<div class="post-metadata">

**Author:** ![zachwlewis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zachwlewis/32/105371_2.png) [@zachwlewis](https://meta.discourse.org/u/zachwlewis)\
**Post date:** [2016年九月29日 20:40 UTC](https://meta.discourse.org/t/how-to-restore-a-backup-of-an-older-version-to-a-fresh-install/50881/7 "2016-09-29T20:40:06Z")

</div>

Sounds good. I’ll be sure to post an update once I get a chance to log in this evening.

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [2016年九月29日 21:23 UTC](https://meta.discourse.org/t/how-to-restore-a-backup-of-an-older-version-to-a-fresh-install/50881/8 "2016-09-29T21:23:46Z")

</div>

> [@zachwlewis](#):
>
> resulting in all my data being lost.

Your data is never lost. On the host machine, look for `postgres_data_old` in `/var/discourse/shared/standalone`

---

<div class="post-metadata">

**Author:** ![zachwlewis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zachwlewis/32/105371_2.png) [@zachwlewis](https://meta.discourse.org/u/zachwlewis)\
**Post date:** [2016年九月29日 22:01 UTC](https://meta.discourse.org/t/how-to-restore-a-backup-of-an-older-version-to-a-fresh-install/50881/9 "2016-09-29T22:01:28Z")

</div>

@Falco It worked! I’m back up and operational! Thank you!

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2016年九月29日 22:02 UTC](https://meta.discourse.org/t/how-to-restore-a-backup-of-an-older-version-to-a-fresh-install/50881/10 "2016-09-29T22:02:29Z")

</div>

🎉 Great!

Thanks for the patience and perseverance!

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2016年十月10日 14:02 UTC](https://meta.discourse.org/t/how-to-restore-a-backup-of-an-older-version-to-a-fresh-install/50881/11 "2016-10-10T14:02:04Z")

</div>


