Pictures gone/deleted after upgrade from 13.1 -> 13.3 #1598

Closed
opened 2026-10-05 00:49:38 +02:00 by adam · 20 comments
Owner

In my piwigo setup I have changed the "upload" folder into a symlink, which points to a raid on my server.

After upgrading to Piwigo 13.3, this symlink is gone, and when checking the folder it was pointing to, its completely empty.

It actually looks like the upgrade process has deleted all of my pictures.

The only images I can find is just thumbnails, located in _data/i/upload.

Luckily I do have a backup of all pictures on a different raid, however I assume not everyone actually has that.

I also had some videos on the raid which I used the "synchronize" feature to add to Piwigo, but they are still present on the raid.
My setup was as following:

/var/www/html/upload -> /raid/piwigo/pictures
/var/www/html/galleries/videos -> /raid/piwigo/videos

So all videos on the raid is still there, but all pictures are gone.
The video symlink is still present, but the "upload" symlink is gone + pictures on raid is gone.

In my piwigo setup I have changed the "upload" folder into a symlink, which points to a raid on my server. After upgrading to Piwigo 13.3, this symlink is gone, and when checking the folder it was pointing to, its completely empty. It actually looks like the upgrade process has deleted all of my pictures. The only images I can find is just thumbnails, located in _data/i/upload. Luckily I do have a backup of all pictures on a different raid, however I assume not everyone actually has that. I also had some videos on the raid which I used the "synchronize" feature to add to Piwigo, but they are still present on the raid. My setup was as following: /var/www/html/upload -> /raid/piwigo/pictures /var/www/html/galleries/videos -> /raid/piwigo/videos So all videos on the raid is still there, but all pictures are gone. The video symlink is still present, but the "upload" symlink is gone + pictures on raid is gone. <!-- github-sync-id:1498152783 -->
adam closed this issue 2026-10-05 00:49:38 +02:00
Author
Owner

I have the same error and are not using symlinks. I just upgraded from 13.1 to 13.3, and ALL images are gone from filesystem, the upload folder is empty now. This is a major critical bug! The database entries and thumbnails are still there.

I have the same error and are not using symlinks. I just upgraded from 13.1 to 13.3, and ALL images are gone from filesystem, the upload folder is empty now. This is a major critical bug! The database entries and thumbnails are still there. <!-- github-comment-id:1352910799 -->
Author
Owner

Or maybe it was during theme/plugin upgrade, don't really know. But seeing this in my log

[2022-12-13 15:45:51]   [DEBUG] extract_plugin_files, $main_filepath = piwigo-openstreetmap/main.inc.php
[2022-12-13 15:45:51]   [DEBUG] extract_plugin_files, $extract_path = ./plugins/piwigo-openstreetmap
[2022-12-13 15:45:51]   [DEBUG] extract_plugin_files, $old_files = {leaflet/tinyscrollbar.min.js},{leaflet/GPX.Speed.js},{leaflet/leaflet-sidebar.js},{leaflet/Control.MiniMap-de.js},{leaflet/jquery.tinycarousel.min.js},{leaflet/GPX.js},{leaflet/tinyscrollbar.js},{leaflet/jquery.tinyscrollbar.js},{leaflet/jquery.tinycarousel.js},{leaflet/jquery.tinyscrollbar.min.js},{leaflet/lea
flet-sidebar.css},{maintain.inc.php},{osmmap2.php.1},{TODO},{leaflet/leaflet.ie.css},{leaflet/MarkerCluster.Default.ie.css},{include/functions_metadata.php},{admin.tpl},{.git/},{admin_boot.php},{admin/admin_sync.tpl},{admin/admin_sync.php},{leaflet/leaflet-search.css},{leaflet/leaflet-search.js},{template/osm-map.tpl.new},{leaflet/L.Control.ViewCenter.css.almost},{leaflet/L.Con
trol.ViewCenter.js},{leaflet/L.Control.Sidebar.js},{leaflet/L.Control.Sidebar.css},{leaflet/L.Control.ViewCenter.css},{admin/admin_gps.tpl},{admin/admin_gps.php},{obsolete.list}
[2022-12-13 15:45:51]   [DEBUG] extract_plugin_files, to delete = ./plugins/piwigo-openstreetmap/obsolete.list
[2022-12-13 15:46:16]   [DEBUG] extract_theme_files, $main_filepath = bootstrap_darkroom/themeconf.inc.php
[2022-12-13 15:46:16]   [DEBUG] extract_theme_files, $extract_path = ./themes/bootstrap_darkroom
[2022-12-13 15:46:16]   [DEBUG] extract_theme_files, $old_files = {slick/},{slick/index.php},{slick/slick-theme.scss},{slick/slick.j

I'm not sure if this "$old_files" thing is deleted? However it does not actually mention the "upload" dir.

However this is apparently not just my setup causing this, this has to get fixed asap before more people loose all their pictures

Or maybe it was during theme/plugin upgrade, don't really know. But seeing this in my log ``` [2022-12-13 15:45:51] [DEBUG] extract_plugin_files, $main_filepath = piwigo-openstreetmap/main.inc.php [2022-12-13 15:45:51] [DEBUG] extract_plugin_files, $extract_path = ./plugins/piwigo-openstreetmap [2022-12-13 15:45:51] [DEBUG] extract_plugin_files, $old_files = {leaflet/tinyscrollbar.min.js},{leaflet/GPX.Speed.js},{leaflet/leaflet-sidebar.js},{leaflet/Control.MiniMap-de.js},{leaflet/jquery.tinycarousel.min.js},{leaflet/GPX.js},{leaflet/tinyscrollbar.js},{leaflet/jquery.tinyscrollbar.js},{leaflet/jquery.tinycarousel.js},{leaflet/jquery.tinyscrollbar.min.js},{leaflet/lea flet-sidebar.css},{maintain.inc.php},{osmmap2.php.1},{TODO},{leaflet/leaflet.ie.css},{leaflet/MarkerCluster.Default.ie.css},{include/functions_metadata.php},{admin.tpl},{.git/},{admin_boot.php},{admin/admin_sync.tpl},{admin/admin_sync.php},{leaflet/leaflet-search.css},{leaflet/leaflet-search.js},{template/osm-map.tpl.new},{leaflet/L.Control.ViewCenter.css.almost},{leaflet/L.Con trol.ViewCenter.js},{leaflet/L.Control.Sidebar.js},{leaflet/L.Control.Sidebar.css},{leaflet/L.Control.ViewCenter.css},{admin/admin_gps.tpl},{admin/admin_gps.php},{obsolete.list} [2022-12-13 15:45:51] [DEBUG] extract_plugin_files, to delete = ./plugins/piwigo-openstreetmap/obsolete.list [2022-12-13 15:46:16] [DEBUG] extract_theme_files, $main_filepath = bootstrap_darkroom/themeconf.inc.php [2022-12-13 15:46:16] [DEBUG] extract_theme_files, $extract_path = ./themes/bootstrap_darkroom [2022-12-13 15:46:16] [DEBUG] extract_theme_files, $old_files = {slick/},{slick/index.php},{slick/slick-theme.scss},{slick/slick.j ``` I'm not sure if this "$old_files" thing is deleted? However it does not actually mention the "upload" dir. However this is apparently not just my setup causing this, this has to get fixed asap before more people loose all their pictures <!-- github-comment-id:1352921578 -->
Author
Owner

Oh my god. There is a bug in the updated patch from 13.x to 13.3.0 (see #1818). There is an obsolete.list file that contain a single line "upload". It means that the update script has to remove this file (or directory).

We have updated the upgrade patch but we're investigating.

Oh my god. There is a bug in the updated patch from 13.x to 13.3.0 (see #1818). There is an `obsolete.list` file that contain a single line "upload". It means that the update script has to remove this file (or directory). We have updated the upgrade patch but we're investigating. <!-- github-comment-id:1353001595 -->
Author
Owner

Thanks for the quick response !

Would be nice with some kind of "unit test" for this case, such that this does not happen in the future. I assume that lots of people don't have backups

Thanks for the quick response ! Would be nice with some kind of "unit test" for this case, such that this does not happen in the future. I assume that lots of people don't have backups <!-- github-comment-id:1353008944 -->
Author
Owner

Would be nice with some kind of "unit test" for this case, such that this does not happen in the future.

For now, I don't understand how it happened :-/

I have added some test in the patch generator :

if ($relative_path eq 'upload' or $relative_path eq 'galleries' or $relative_path eq 'local') {
  print "\n\n".'/!\ ERROR /!\ unexpected directory for obsolete.list : '.$relative_path."\n\n";
  exit;
}

I assume that lots of people don't have backups

Maybe, but we can't be blamed for that :-/ I'm not proud of this bug but having no backup is even worse.

> Would be nice with some kind of "unit test" for this case, such that this does not happen in the future. For now, I don't understand how it happened :-/ I have added some test in the patch generator : ``` if ($relative_path eq 'upload' or $relative_path eq 'galleries' or $relative_path eq 'local') { print "\n\n".'/!\ ERROR /!\ unexpected directory for obsolete.list : '.$relative_path."\n\n"; exit; } ``` > I assume that lots of people don't have backups Maybe, but we can't be blamed for that :-/ I'm not proud of this bug but having no backup is even worse. <!-- github-comment-id:1353071185 -->
Author
Owner

Sure, we shouldn't point fingers. People should always have backup. Piwigo has been working perfect ever since I started back in 2014.

But I guess we should also learn from this experience, and add some extra safe-guards.

Sure, we shouldn't point fingers. People should always have backup. Piwigo has been working perfect ever since I started back in 2014. But I guess we should also learn from this experience, and add some extra safe-guards. <!-- github-comment-id:1353077631 -->
Author
Owner

EDIT: My bad, I restored the whole Piwigo home folder from backup too, and I'd previously had a sym link for upload -> /home/albums/upload that needed to be recreated as well as restoring the files.

Is the "check upload" plug in working right ?

I've restored my (was empty) upload folder from backup, and https://rachaelandtom.info/photos/admin.php?page=plugin-check_uploads reports

651 files are listed in the database, but not available in the filesystem
2018/02/02/20180202124508-34b7e032.jpg is in the database, not in the filesystem
....

and yet the restored file appears in the right place :

# pwd
/home/albums
# ls -laht upload/2018/02/02/20180202124508-34b7e032.jpg
-rw-r--r-- 1 apache apache 3.4M Feb  2  2018 upload/2018/02/02/20180202124508-34b7e032.jpg
#

pressing "check upload" button on the results page completes suspiciously quickly.

Is there a way to find out the complete path that is "missing" ?

I have a symlink galleries -> /home/albums/albums but don't think I've changed much else

EDIT: My bad, I restored the whole Piwigo home folder from backup too, and I'd previously had a sym link for `upload -> /home/albums/upload` that needed to be recreated as well as restoring the files. Is the "check upload" plug in working right ? I've restored my (was empty) upload folder from backup, and https://rachaelandtom.info/photos/admin.php?page=plugin-check_uploads reports ``` 651 files are listed in the database, but not available in the filesystem 2018/02/02/20180202124508-34b7e032.jpg is in the database, not in the filesystem .... ``` and yet the restored file appears in the right place : ``` # pwd /home/albums # ls -laht upload/2018/02/02/20180202124508-34b7e032.jpg -rw-r--r-- 1 apache apache 3.4M Feb 2 2018 upload/2018/02/02/20180202124508-34b7e032.jpg # ``` pressing "check upload" button on the results page completes suspiciously quickly. Is there a way to find out the complete path that is "missing" ? I have a symlink `galleries -> /home/albums/albums` but don't think I've changed much else <!-- github-comment-id:1355329763 -->
Author
Owner

@tomchiverton so it's fine now? (please don't scare me more than necessary)

@tomchiverton so it's fine now? (please don't scare me more than necessary) <!-- github-comment-id:1355611867 -->
Author
Owner

I am having issues with pictures not loading if I access Piwigo from my server online or through the mobile app. I took screen-caps if they are helpful I can post. When I went back today to see if the photos in the app are also missing on my web site they are not, at least in the directories I took screencaps of.

I am having issues with pictures not loading if I access Piwigo from my server online or through the mobile app. I took screen-caps if they are helpful I can post. When I went back today to see if the photos in the app are also missing on my web site they are not, at least in the directories I took screencaps of. <!-- github-comment-id:1355766435 -->
Author
Owner

@dustindd if you upgraded Piwigo earlier this month, it will have wiped your 'upload' folder.

By default this is in the install folder for Piwigo, and contains all your pictures.

Is this the case for you ? You can for instance see if that folder is there, and what's in it.

It's possible to reconfigure this folder location; you'd have to tell us if you'd done that, and perform the same "is it there, what's in it" check on it.

If it's gone, the only recovery is restore from backup :(

@dustindd if you upgraded Piwigo earlier this month, it will have wiped your 'upload' folder. By default this is in the install folder for Piwigo, and contains all your pictures. Is this the case for you ? You can for instance see if that folder is there, and what's in it. It's possible to reconfigure this folder location; you'd have to tell us if you'd done that, and perform the same "is it there, what's in it" check on it. If it's gone, the only recovery is restore from backup :( <!-- github-comment-id:1356150056 -->
Author
Owner

If it's gone, the only recovery is restore from backup :(

In plugin Check Uploads version 13.b, I have implemented a system to restore from the multiple sizes cache. Quality will obviously be lower than the original files, but it's better than restoring nothing if you have no backup.

> If it's gone, the only recovery is restore from backup :( In plugin Check Uploads version 13.b, I have implemented a system to restore from the multiple sizes cache. Quality will obviously be lower than the original files, but it's better than restoring nothing if you have no backup. <!-- github-comment-id:1359214587 -->
Author
Owner

So, I don't have a backup of the uploads folder - but I do have all the images that was uploaded just in a slightly different folder structure, but with the same filenames.

Are there any process or tool that could let me copy all of these files into the right spot in the uploads folder?

So, I don't have a backup of the uploads folder - but I do have all the images that was uploaded just in a slightly different folder structure, but with the same filenames. Are there any process or tool that could let me copy all of these files into the right spot in the uploads folder? <!-- github-comment-id:1372894684 -->
Author
Owner

Did a quick bit of exploration, and it seems that the piwigo_images table has both the original filename and most importantly also the md5sum of the original image, so it should not be that hard to do the matching.

Does the "check upload" plugin overwrite the md5sum column when you use the "restore from cache" feature? Asking because I used the feature, and might have to determine some way of spotting these "restored" images and overwrite them with an original image.

Did a quick bit of exploration, and it seems that the `piwigo_images` table has both the original filename and most importantly also the md5sum of the original image, so it should not be that hard to do the matching. Does the "check upload" plugin overwrite the `md5sum` column when you use the "restore from cache" feature? Asking because I used the feature, and might have to determine some way of spotting these "restored" images and overwrite them with an original image. <!-- github-comment-id:1373565998 -->
Author
Owner

Hello/Hi/Greetings,

Hi all,
since the desaster loosing photos last year , I also lost photos, but I didn't follow then the posts here.

But now I want to repair my gallery.

In my gallery there are 2673 photos missing according to the message of CheckUpload V13.d.
The text/comments to each picture is still showing up.
I still have all pictures in my picture backup (not database )

NOW MY QUESTION: how can I add these picture in my gallery on the SAME POSITION where the text is?
If there are already help information in this forum, please send me the links.

My PIWIGO Version 13.8.0, the version CheckUpload V13.d

regards , Alhard

Hello/Hi/Greetings, Hi all, since the desaster loosing photos last year , I also lost photos, but I didn't follow then the posts here. But now I want to repair my gallery. In my gallery there are 2673 photos missing according to the message of CheckUpload V13.d. The text/comments to each picture is still showing up. I still have all pictures in my picture backup (not database ) NOW MY QUESTION: how can I add these picture in my gallery on the SAME POSITION where the text is? If there are already help information in this forum, please send me the links. My PIWIGO Version 13.8.0, the version CheckUpload V13.d regards , Alhard <!-- github-comment-id:1700747463 -->
Author
Owner

In your database, you can find the filename of the picture, and the file path it's expected to be found. Then I wrote a bash script which copied the backup image into the correct file path. And I don't have this script anymore. I had several thousands of pictures I lost, and had to restore.

In your database, you can find the filename of the picture, and the file path it's expected to be found. Then I wrote a bash script which copied the backup image into the correct file path. And I don't have this script anymore. I had several thousands of pictures I lost, and had to restore. <!-- github-comment-id:1700881648 -->
Author
Owner

100% the easiest approach is just to restore the photo files from a backup.

100% the easiest approach is just to restore the photo files from a backup. <!-- github-comment-id:1701029846 -->
Author
Owner

Thanks to you both, but how can I synchronize my existing title text with the pictures?? All titles of at least 500 pictures are still existent in my gallery.

Thanks to you both, but how can I synchronize my existing title text with the pictures?? All titles of at least 500 pictures are still existent in my gallery. <!-- github-comment-id:1701135033 -->
Author
Owner

Well, that's a different thing. Have you asked on the forum?

†øღ
Sent from a super computer that fits in my pocket and is connected to the sum total of all human knowledge

On 31 August 2023 15:13:37 BST, alihor @.***> wrote:

Thanks to you both, but how can I synchronize my existing title text with the pictures?? All titles of at least 500 pictures are still existent in my gallery.

--
Reply to this email directly or view it on GitHub:
https://github.com/Piwigo/Piwigo/issues/1827#issuecomment-1701135033
You are receiving this because you were mentioned.

Message ID: @.***>

Well, that's a different thing. Have you asked on the forum? -- †øღ Sent from a super computer that fits in my pocket and is connected to the sum total of all human knowledge On 31 August 2023 15:13:37 BST, alihor ***@***.***> wrote: >Thanks to you both, but how can I synchronize my existing title text with the pictures?? All titles of at least 500 pictures are still existent in my gallery. > >-- >Reply to this email directly or view it on GitHub: >https://github.com/Piwigo/Piwigo/issues/1827#issuecomment-1701135033 >You are receiving this because you were mentioned. > >Message ID: ***@***.***> <!-- github-comment-id:1701177756 -->
Author
Owner

Yes I did, but no response currently.
I am still looking for the path of my pictures with FileZilla, but I didnt find the Path. In /web/piwigo/galleries I didn't find it.
I have this piwigo database on a server provider in Germany.

Yes I did, but no response currently. I am still looking for the path of my pictures with FileZilla, but I didnt find the Path. In /web/piwigo/galleries I didn't find it. I have this piwigo database on a server provider in Germany. <!-- github-comment-id:1701323047 -->
Author
Owner

Where can I read about the binding between the picture and the title?

Where can I read about the binding between the picture and the title? <!-- github-comment-id:1701324378 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1598