How to restore attachments

Hi, recently some users complained about missing pictures and not able to download attachments. we are running old discourse 1.9.0 beta15 and plan to upgrade to latest version.

After investigation, I was able to restore pictures by copy/paste from ‘tombstone’ folder to ‘default’ folder. (As a workaround)
Pictures are visible as before. Fine.

Unfortunately, doing the same for missing attachments doesn’t work. Even if I restore file (.zip, .html, txt, etc) in correct location, discourse displays “Oops! that page doesn’t exist or is private”.
For zip file, if I try to download it, I see “Failed - no file”

Is there anything else I can do to repair this?
In the case I cannot fix attachments, the restore of our DB backup in new version of discourse could be affected as well?

Thanks,
/Thierry

1 Like

You can search for "recover from tombstone’ for some things to try.

1 Like

Any advice here @vinothkannans? Maybe an existing topic?

It sounds like the files available in the correct location but the upload records are not found in DB. In that case, non-image uploads won’t be downloaded even if they’re available in local storage. You should run the rake uploads:recover rake task to fix the issue. Before, set the site setting purge deleted uploads grace period days value to the maximum to prevent the loss of data.

If the above rake task didn’t fix the issue then you should upgrade to the latest version and try the rake task again.

3 Likes

Thanks Vinoth, I will have a look.