TL;DR - had to rebuild my PhotoPrism database and now my originals count is off by ~5,000. Can I do a full sync of my devices and have it only upload what is missing?

Hello gurus,

I’ve been running Photoprism for quite some time and I’m happy with it.

I ran to an unrelated issue with my database (MariaDB) and has to rebuild the database. PhotoPrism uses this instance of MariaDB so naturally the metadata was gone.

The original pictures (originals) were stored in a separate array so at a minimum I still have all my pictures. I rebuilt the database and PhotoPrism (docker container) and pointed it to the array for the originals. Once that was done, I logged in to the PhotoPrism UI and perform a complete rescan and index of my originals. Once it was done, I noticed that my originals count was 27,000 but i should have 31,000 objects (according to a picture I took of the PhotoPrism UI I took the night before rebuilding the database). So I started digging a bit.

  • The array itself (where my originals are stored) is showing 27,000 objects.

  • The pictures I took the night before rebuilding the database and PhotoPrism containers said that the count of originals was ~31,000.

  • The two main devices backing media to PhotoPrism is my phone and my wife’s phone. My phone shows ~4,500 and my wife’s sores ~26,500.

  • Since these two phones are previously fully backups a few weeks before the rebuild I should have ~31,000 objects in the originals.

My question is, can I redo a full backups sync of both phones (through PhotoSync) and have it only copy the objects that are not in the originals?

Since the database has to be rebuilt, I fear that if I do another full sync, it will just copy everything again and I end up with ~60,000 objects rather than the ~31,000 I should have.

What can I do to see which objects are missing between my devices and PhotoPrism and how can I only copy those over to PhotoPrism?

  • czardestructo@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 year ago

    I think a full resync then re-index will go fine. My setup is different in that I sync everything through Nextcloud and run a script that looks for changes and triggers an indexing scan in photoprism. That being said I’ve absolutely mutilated some photo prism databases (migrating servers, different folder names with the same content) and run full indexing and never ended up with duplicates. It’s very good at stacking and cleaning up the same files in the DB so long as there aren’t actual duplicates in the original storage. But again it might take 3 or more full scans to find and purge duplicates.

    • lal309@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Well that’s good news. For now, I’ve created a different path in my array. I’ve reconfigured photoprism to look at this new path for the originals and cleared out the database one more time. I’m in the process of fully reuploading/resyncing my devices (two phones). Once I have that then I will write up a script to see which objects are missing from the old path to the new and viceversa to figure out why Im short ~5,000 objects. Once I have that list then I can rehollad the missing objects and im back in business (hopefully)