"lost" library

After spending a few days importing Photostructure was done and I had a nice library with 30k photos. During this time I had to stop the container to change the memory limit. After it came back up it continued the import.

However after a reboot I saw high CPU usage and checked Photostructure, only to find my library empty :fearful:

The files are still on the system and Photostructure has not replaced any of them so it does recognise the files. I checked the logs and couldn’t find any clues.

Any ideas what it might be?

Apologies that PhotoStructure misbehaved for you!

You can see if any of the backups of your database are reasonable:

Restoring from a backup, though, is only reasonable if PhotoStructure hasn’t run any sync jobs since your database was reset/truncated.

The library database and previews directory work in concert with each other. If your database got truncated, the asset IDs from the prior database instance won’t match the new database, so sync will result in the DB and previews being (ironically) out of sync.

What version are your running?

Also, if your library is on a locally stored volume, I’d set the environment variable PS_FORCE_LOCAL_DB_REPLICA=false which may prevent this in the future.

1 Like

Perfect that worked :partying_face:

I am running 1.0.0-beta.9 (I know I know…)

I copied the DB from yesterday replacing the previous “db.sqlite3”. Something happened at 12:53 that made PhotoStructure create a new blank DB (going from 67.6MB to 672KB).

Glad that helped.

I’ll take another look at the DB backup code today and see how this could have happened and how to prevent this in the future.