# Images lost after restore from backup (very old discourse install)

**URL:** https://meta.discourse.org/t/images-lost-after-restore-from-backup-very-old-discourse-install/112289
**Category:** Support
**Created:** [21 במרץ,‏ 2019,‏ 9:13pm UTC](https://meta.discourse.org/t/images-lost-after-restore-from-backup-very-old-discourse-install/112289 "2019-03-21T21:13:25Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [21 במרץ,‏ 2019,‏ 9:13pm UTC](https://meta.discourse.org/t/images-lost-after-restore-from-backup-very-old-discourse-install/112289/1 "2019-03-21T21:13:25Z")

</div>

I had an old ubuntu host that I didn’t feel like upgrading to ubuntu 18.

I followed the new host setup steps, then restored.

The site is up & going, but images seem to be missing.

All the files seem to be in the tombstone, but `rake uploads:recover_from_tombstone` doesn’t seem to help (nor does it fail with any error)

Rebuilding HTML on an individual post doesn’t work.

What could be done to get the images showing again?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [22 במרץ,‏ 2019,‏ 6:03am UTC](https://meta.discourse.org/t/images-lost-after-restore-from-backup-very-old-discourse-install/112289/2 "2019-03-22T06:03:55Z")

</div>

The domain name did not change?

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [23 באפריל,‏ 2019,‏ 4:13am UTC](https://meta.discourse.org/t/images-lost-after-restore-from-backup-very-old-discourse-install/112289/3 "2019-04-23T04:13:07Z")

</div>

I’ve just had a heck of a time with this.. and can confirm that this command was never run:

```plaintext
 rails c
[1] pry(main)> OnceoffLog.where(job_name: "RecoverPostUploads").count
=> 0

```

How were we supposed to know to do this?

---

<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: [23 באפריל,‏ 2019,‏ 4:15am UTC](https://meta.discourse.org/t/images-lost-after-restore-from-backup-very-old-discourse-install/112289/4 "2019-04-23T04:15:21Z")

</div>

You weren’t supposed to do this by hand.

Try

```plaintext
rails c
OnceoffLog.where(job_name: "PostUploadsRecovery").count

```

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [23 באפריל,‏ 2019,‏ 5:59am UTC](https://meta.discourse.org/t/images-lost-after-restore-from-backup-very-old-discourse-install/112289/5 "2019-04-23T05:59:02Z")

</div>

At this point, It’s

```plaintext
# rails c
[1] pry(main)> OnceoffLog.where(job_name: "PostUploadsRecovery").count
=> 1
[2] pry(main)> 

```

Before I ran `rake posts:missing_uploads` the output of `OnceoffLog.where(job_name:"RecoverPostUploads").count` was `0`

---

<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: [23 באפריל,‏ 2019,‏ 7:38am UTC](https://meta.discourse.org/t/images-lost-after-restore-from-backup-very-old-discourse-install/112289/6 "2019-04-23T07:38:20Z")

</div>

Note that the job name is different here so running the `rake posts:missing_uploads` didn’t change the count.

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [23 באפריל,‏ 2019,‏ 9:27pm UTC](https://meta.discourse.org/t/images-lost-after-restore-from-backup-very-old-discourse-install/112289/7 "2019-04-23T21:27:28Z")

</div>

Got it, yes, `OnceoffLog.where(job_name: "RecoverPostUploads").count` is still `0`

I’m looking at a way to push up every file from the backup I’m using.

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [10 במאי,‏ 2019,‏ 7:39pm UTC](https://meta.discourse.org/t/images-lost-after-restore-from-backup-very-old-discourse-install/112289/8 "2019-05-10T19:39:03Z")

</div>

This issue was ultimately solved in

> [@How to find any missing images?](https://meta.discourse.org/t/how-to-find-any-missing-images/115672/10):
>
> Upgrade to the latest version of Discourse and run the task rake posts:missing\_uploads again. The task itself will try to recover the missing old scheme uploads from local “uploads” and “tombstone” directories. At the end it will display the count of the uploads which are not found both in database and local storage.

---

<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: [9 ביוני,‏ 2019,‏ 7:39pm UTC](https://meta.discourse.org/t/images-lost-after-restore-from-backup-very-old-discourse-install/112289/9 "2019-06-09T19:39:11Z")

</div>

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