# Why are images missing after restoring the database?

**URL:** <https://forum.litium.com/t/why-are-images-missing-after-restoring-the-database/2851>\
**Category:** Questions\
**Tags:** litium-8\
**Created:** [February 16, 2023, 9:21am UTC](https://forum.litium.com/t/why-are-images-missing-after-restoring-the-database/2851 "2023-02-16T09:21:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![wiseby](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/wiseby/32/959_2.png) [@wiseby](https://forum.litium.com/u/wiseby)\
**Post date:** [February 16, 2023, 9:21am UTC](https://forum.litium.com/t/why-are-images-missing-after-restoring-the-database/2851/1 "2023-02-16T09:21:55Z")

</div>

Every now and then I need to restore the database so that I can troubleshoot some issues in a staging/prod environment. Every time I do this my image references are broken and no images works anymore, not even for products that existed before the restore (and exists in the backup).

Steps to reproduce:

- containers are running, Mvc application is not running.
- Restoring the Litium database from a file backup in SSMS.
- Starts the Mvc application.
- Enters BackOffice and rebuilds all elasic indicies.

Is there any steps I have missed or is it not possible to do it this way?  
Is it even possible to persist images this way?

Litium version: _8.7.1_

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [February 16, 2023, 10:00am UTC](https://forum.litium.com/t/why-are-images-missing-after-restoring-the-database/2851/2 "2023-02-16T10:00:14Z")

</div>

Media (images/files) are not stored in database so they manuella need to be copied from the source environment into your local environment.

---

<div class="post-metadata">

**Author:** ![wiseby](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/wiseby/32/959_2.png) [@wiseby](https://forum.litium.com/u/wiseby)\
**Post date:** [February 20, 2023, 11:47am UTC](https://forum.litium.com/t/why-are-images-missing-after-restoring-the-database/2851/3 "2023-02-20T11:47:03Z")

</div>

Yes I understand that, but as I wrote in the question I thought that the products that existed before the restore should work after, but that’s not true. I know that all newer products has missing images but the old once is still present in the media folder. The only thing that has changed is the database.

---

<div class="post-metadata">

**Author:** ![utku](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/utku/32/62_2.png) [@utku](https://forum.litium.com/u/utku)\
**Post date:** [February 20, 2023, 1:03pm UTC](https://forum.litium.com/t/why-are-images-missing-after-restoring-the-database/2851/4 "2023-02-20T13:03:52Z")

</div>

Are you using redis? Did you increase the rev number of your redis prefix after the restore and restart the application?

---

<div class="post-metadata">

**Author:** ![wiseby](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/wiseby/32/959_2.png) [@wiseby](https://forum.litium.com/u/wiseby)\
**Post date:** [February 20, 2023, 2:22pm UTC](https://forum.litium.com/t/why-are-images-missing-after-restoring-the-database/2851/5 "2023-02-20T14:22:27Z")

</div>

Ahh that could be the case. Thank you, testing that right away.

---

<div class="post-metadata">

**Author:** ![wiseby](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/wiseby/32/959_2.png) [@wiseby](https://forum.litium.com/u/wiseby)\
**Post date:** [February 24, 2023, 7:53am UTC](https://forum.litium.com/t/why-are-images-missing-after-restoring-the-database/2851/6 "2023-02-24T07:53:13Z")

</div>

Unfortunatly the redis prefix bump didnt work. Im about to do some more investigating in the db to pinpoint the issue. Must be that the paths for the images have changed or something.

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [February 24, 2023, 8:55am UTC](https://forum.litium.com/t/why-are-images-missing-after-restoring-the-database/2851/7 "2023-02-24T08:55:39Z")

</div>

If you have an previous copy of the storage/media folders it may be that the images that you see missing is new or changes from when you was copying these folder the last time.

Try to download the storage/media folders again to see that all files are there. Also ensure that the configuration pointing to the correct folder and if the folder is on a shared server ensure that the account the site is running below hav access to the folder as well.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [March 24, 2023, 8:56am UTC](https://forum.litium.com/t/why-are-images-missing-after-restoring-the-database/2851/8 "2023-03-24T08:56:07Z")

</div>

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