# Restore from a Backup

**URL:** https://meta.discourse.org/t/restore-from-a-backup/154732
**Category:** Support
**Created:** [June 13, 2020, 6:54am UTC](https://meta.discourse.org/t/restore-from-a-backup/154732 "2020-06-13T06:54:40Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Samir\_Faci](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/samir_faci/32/119582_2.png) [@Samir\_Faci](https://meta.discourse.org/u/Samir_Faci)
#### Post date: [June 13, 2020, 6:54am UTC](https://meta.discourse.org/t/restore-from-a-backup/154732/1 "2020-06-13T06:54:40Z")

</div>

I had to restore my DigitalOcean back to a previous build. That’s a week old and naturally I have S3 backups so I thought It’d be an easy point and click and I’m back to at worst losing a days worth of data.

So, then I ran into an issue and the restore failed, I eventually stumbled upon this post:

> [@Restore from backup fails due to S3 migration](https://meta.discourse.org/t/restore-from-backup-fails-due-to-s3-migration/127409):
>
> I tried to migrate my discourse instance to a new server, and restore via UI and CLI fail during restore operation. It has to do with S3 migration. I also had these settings enabled in rails console SiteSetting.migrate\_to\_new\_scheme = true Jobs::MigrateUploadScheme.new.execute(nil) The relevant log from the failure was: Remapping '//thinnal.s3.dualstack.us-east-1.amazonaws.com/' to '/uploads/default/' incoming\_emails=2 optimized\_images=3851 post\_revisions=86 posts=618 stylesheet\_cache=10 t…

So I downloaded the latest version of my backup, extracted the content. I unzipped dump.sql.gz and modified the content searching for all occurrences of:

enable\_s3\_uploads making sure the value is set to false.

The restore is successful, except for the fact that every single image in our forum is missing.

How do I fix this? I think i’m going to revert back to my week old backup. I’d rather miss a week of data then lose every image that was uploaded.

Any help would be appreciated.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 13, 2020, 8:39pm UTC](https://meta.discourse.org/t/restore-from-a-backup/154732/2 "2020-06-13T20:39:40Z")

</div>

Are your images in S3? Did you have `enable_s3_uploads` set before?

Or do you have a full backup that includes the images in a `.tar.gz` file?

---

<div class="post-metadata">

### Author: ![Samir\_Faci](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/samir_faci/32/119582_2.png) [@Samir\_Faci](https://meta.discourse.org/u/Samir_Faci)
#### Post date: [June 13, 2020, 9:43pm UTC](https://meta.discourse.org/t/restore-from-a-backup/154732/3 "2020-06-13T21:43:53Z")

</div>

Yes many of my images are in S3. I had to set enable\_s3\_upload to false due to the restore issue.

Once it’s turned off all the S3 images weren’t restored which makes sense logically but doesn’t help me with my issue.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 14, 2020, 5:56am UTC](https://meta.discourse.org/t/restore-from-a-backup/154732/4 "2020-06-14T05:56:30Z")

</div>

Are they still in S3? Where do the posts link to?

---

<div class="post-metadata">

### Author: ![Samir\_Faci](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/samir_faci/32/119582_2.png) [@Samir\_Faci](https://meta.discourse.org/u/Samir_Faci)
#### Post date: [June 16, 2020, 6:39pm UTC](https://meta.discourse.org/t/restore-from-a-backup/154732/5 "2020-06-16T18:39:22Z")

</div>

So this is no longer pressing issue for me, but I’ll provide as much info for anyone find this helpful.

The files still existed in S3. Even though the files were available on S3 it wasn’t able to determine how to render the files with the s3\_enabled flag disabled. Enabling the flag again didn’t fix the issue.

I reverted to a previous VM snapshot which lost a few post but it’s more acceptable to me than the state of the restored state.

That being said, having daily backups when i can’t restore it seems like a pretty critical bug. I really was hoping that bug i linked above would have been fix already, it was open since September. :\
