# Unable to restore from S3 backup - Fails

**URL:** <https://meta.discourse.org/t/unable-to-restore-from-s3-backup-fails/358243>\
**Category:** Product Support\
**Created:** [March 20, 2025, 10:31pm UTC](https://meta.discourse.org/t/unable-to-restore-from-s3-backup-fails/358243 "2025-03-20T22:31:52Z")\
**Posts on this page:** 7\
**Page:** 1

## AI-generated summary

[TehLeo](/t/-/358243/1) is unable to restore a Discourse backup from S3, encountering a failure during the restore process with no clear indication of the root cause. Despite troubleshooting S3 connectivity and attempting manual CLI restores, the issue persists. [Canapin](/t/-/358243/3) suggests reviewing similar error logs on Meta Discourse and references a guide for handling problematic data during a paused restore. Following this, [TehLeo](/t/-/358243/4) identifies 9 problematic posts via a database query but is unsure how to proceed. [Canapin](/t/-/358243/5) provides detailed instructions for modifying or deleting problematic posts or uploads during a paused restore using the Rails console. [TehLeo](/t/-/358243/6) successfully deletes the 9 posts using `Post.find(id#).destroy` but does not confirm whether this was done during a paused restore. [Canapin](/t/-/358243/7) follows up to confirm whether the deletion occurred during the paused state, as proper timing is critical for the restore to proceed correctly.

<div class="post-metadata">

**Author:** ![TehLeo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tehleo/32/495075_2.png) [@TehLeo](https://meta.discourse.org/u/TehLeo)\
**Post date:** [March 20, 2025, 10:31pm UTC](https://meta.discourse.org/t/unable-to-restore-from-s3-backup-fails/358243/1 "2025-03-20T22:31:52Z")

</div>

I’m unable to restore from a S3 Backup of Discourse.

Steps to reproduce:

1. Have a Backup of Discourse on S3.
2. Setup a fresh install of Discourse.
3. Create admin account.
4. Connect Discourse to S3
5. Locate the Discourse backup in my S3 backup lists
6. Enable restore
7. Attempt restore
8. Restore Fails

Log:

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/5/c/35ca8da991fc76c7d7256085ad5e6be57ae0bbf1.png)

I’ve tried everything I could with troubleshooting S3. I even attempted to move the backup to the server, and performed a CLI / Manual restore. It fails with the same log. I’ve tried turning off S3 Uploads. I’m unsure what my next troubleshooting steps are, or how to see exactly what post is causing the issue / remove it.

Thank you for any help!

---

<div class="post-metadata">

**Author:** ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)\
**Post date:** [March 20, 2025, 10:56pm UTC](https://meta.discourse.org/t/unable-to-restore-from-s3-backup-fails/358243/3 "2025-03-20T22:56:55Z")

</div>

Welcome! :blob_wave:

> [@TehLeo](#):
>
> I’ve tried everything

Does “everything” include looking at similar error logs here?

[https://meta.discourse.org/search?q=%22posts%20are%20not%20remapped%22%20%22s3%20migration%20failed%22%20order%3Alatest](https://meta.discourse.org/search?q=%22posts%20are%20not%20remapped%22%20%22s3%20migration%20failed%22%20order%3Alatest)

This result in particular:

> [@Issues with restoring backup to discourse](https://meta.discourse.org/t/issues-with-restoring-backup-to-discourse/357885/16):
>
> This sounds like the problem mentioned in [Can't restore a backup if it includes link to Discourse onebox](https://meta.discourse.org/t/cant-restore-a-backup-if-it-includes-link-to-discourse-onebox/329071) anxious_face_with_sweat You should be able to fix this during the restore, but you need to do it on the shell. cd /var/discourse ./launcher enter app # start the restore with the --pause argument discourse restore --pause \<backup\_filename\> It will pause the restore process at two points: Before DB migrations are run – you can ignore that; press a key to continue Before Uploads are res…

---

<div class="post-metadata">

**Author:** ![TehLeo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tehleo/32/495075_2.png) [@TehLeo](https://meta.discourse.org/u/TehLeo)\
**Post date:** [March 20, 2025, 11:16pm UTC](https://meta.discourse.org/t/unable-to-restore-from-s3-backup-fails/358243/4 "2025-03-20T23:16:08Z")

</div>

I followed these instructions, and I recieved 9 posts from the quarry. The old post doesn’t detail what to do with these posts, or how to correct the issue past this point.

---

<div class="post-metadata">

**Author:** ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)\
**Post date:** [March 20, 2025, 11:47pm UTC](https://meta.discourse.org/t/unable-to-restore-from-s3-backup-fails/358243/5 "2025-03-20T23:47:11Z")

</div>

⚠ This is what [ask.discourse.org](http://ask.discourse.org) returns, I cannot guarantee it’s safe or that it even works

* * *

> [@On another topic](https://meta.discourse.org/t/6114/4):
>
> During a paused restore, you have an opportunity to temporarily modify or clean up problematic data such as uploads or posts in the database before Discourse proceeds with completing the restoration process. Here’s how you can handle or modify the problematic data during a paused restore step-by-step.
> 
> * * *
> 
> ### **Steps to Manually Handle Problematic Data in a Paused Restore**
> 
> 1. **Initiate the Restore with Pausing:**  
> Run the restore with the `--pause` flag to allow the restoration process to pause before uploads or remappings are applied:
> 
> 2. **Point of Pausing:**
> 
> 3. **Open a New SSH Session:**  
> While the restoration is paused, open a **new SSH session** to interact with the paused instance without interrupting the restore process:
> 
> 4. **Access the Rails Console:**  
> Enter the Rails console to interact with the database:
> 
> 5. **Identify Problematic Posts:**
> 
> 6. **Modify or Delete Problematic Posts:**
> 
> 7. **Modify Uploads if Necessary:**  
> If the issue stems from specific problematic uploads:
> 
> 8. **Resume the Restore Process:**  
> After making necessary modifications, return to the paused shell session and press any key to resume the restore process.
> 
> * * *
> 
> ### **Important Considerations:**
> 
> - Always create a backup of the original database file before modifying any content.
> - Focus on correcting minimal data—that is, only address problematic content without making unnecessary changes.
> - If the upload is external (a URL or CDN-related issue), you can remove the external reference manually during restoration.

---

<div class="post-metadata">

**Author:** ![TehLeo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tehleo/32/495075_2.png) [@TehLeo](https://meta.discourse.org/u/TehLeo)\
**Post date:** [March 20, 2025, 11:47pm UTC](https://meta.discourse.org/t/unable-to-restore-from-s3-backup-fails/358243/6 "2025-03-20T23:47:35Z")

</div>

So I was able to just delete all 9 posts using the following Rails command:  
Post.find(id#).destroy

---

<div class="post-metadata">

**Author:** ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)\
**Post date:** [March 20, 2025, 11:49pm UTC](https://meta.discourse.org/t/unable-to-restore-from-s3-backup-fails/358243/7 "2025-03-20T23:49:27Z")

</div>

Did you run this while the restore was paused?

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [April 19, 2025, 11:50pm UTC](https://meta.discourse.org/t/unable-to-restore-from-s3-backup-fails/358243/8 "2025-04-19T23:50:14Z")

</div>

Closed on April 19, 2025, 11:50pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
