# Images tombstoned after import

**URL:** https://meta.discourse.org/t/images-tombstoned-after-import/74912
**Category:** Support
**Created:** [November 28, 2017, 12:49am UTC](https://meta.discourse.org/t/images-tombstoned-after-import/74912 "2017-11-28T00:49:07Z")
**Posts on this page:** 4
**Page:** 1

<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: [November 28, 2017, 12:49am UTC](https://meta.discourse.org/t/images-tombstoned-after-import/74912/1 "2017-11-28T00:49:07Z")

</div>

It seems that after an import images get moved to tombstone. I run

```
rake uploads:recover_from_tombstone

```

and they come back, but I would rather figure out how to avoid waiting for them to get tombstoned and then move them back.

I’ve seen @gerhard recommend running redis on the dev box, but I just do a backup and move them to production. Is that what my problem is?

---

<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: [November 28, 2017, 9:55am UTC](https://meta.discourse.org/t/images-tombstoned-after-import/74912/3 "2017-11-28T09:55:08Z")

</div>

Images are tombstoned iif they’re orphaned (ie. not linked anywhere in the application).

(_Wow, that sentence is very sad…_)

Images are linked to posts in the [`CookedPostProcessor`](https://github.com/discourse/discourse/blob/8a0d7bb922913ee07fc5185587be1def8a99f6bb/lib/cooked_post_processor.rb#L59-L77) class which is run in a background job after a post is saved.

This jobs requires sidekiq to be running but since it’s almost never the case in imports for performance reasons, the link is never stored in the database.

What @gerhard advised is the proper way of fixing this issue

- run the import with sidekiq not running
- once the import is done, launch sidekiq and wait for it to finish post processing all the posts
- backup your import and move it to production

---

<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: [November 28, 2017, 4:04pm UTC](https://meta.discourse.org/t/images-tombstoned-after-import/74912/4 "2017-11-28T16:04:21Z")

</div>

I see, and those things get queued up when the importer runs, and if you back up and restore elsewhere that doesn’t happen. And it’s taken me only a year and several dozen imports to figure that out!

Thanks, @zogstrip!

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:43pm UTC](https://meta.discourse.org/t/images-tombstoned-after-import/74912/5 "2024-06-08T12:43:53Z")

</div>

This topic was automatically closed after 2384 days. New replies are no longer allowed.
