3

I've had a photo library managed by my Mac since iPhoto on Mac OS X 10.5 Leopard. This library has migrated across every macOS update since then, migrated from iPhoto to Photos.app, and even moved across three Macs over those years.

However, I've been struggling for the last year or so that it never finishes recognizing people and even in my latest import of 1000 pictures a week ago, Photos.app on Ventura doesn't seem to be making much progress and even in the recent imports it isn't highlighting faces (unknown or otherwise). It feels like Photos.app is getting stuck.

I have noticed in the past by looking at the Console that Photos.app can blow up on files it doesn't know how to handle. For example, I had some old AVIs in the library that were recorded by an ancient Logitech device which had a codec that the Mac couldn't handle, and I eventually realized those files were landmines to photoanalysisd. I converted them with Handbrake and now they're modern and happy (the old AVIs were removed). I believe I only have "modern" files now. That being said, I still don't think things work right, but Console doesn't tell me enough to fix more files.

So what I'm looking for is if there is a way to take my entire photo library and get Photos.app to "start over". I've tried Photos repair applications, but that doesn't seem to fix it. What I think I'd like to try is to export EVERYTHING and start a new library and let the app start over from scratch. However, there is a ton of metadata in there (customized locations, comments, etc.) that I don't want to lose.

Is there a way to export and re-import without losing any metadata?

NOTE: While I do have iCloud shared libraries enabled, my main library is NOT stored on iCloud, it is ONLY on my local disks (yes, I do have backups!)

3
  • Do you use iCloud photo library?
    – Ezekiel
    Commented Oct 26, 2023 at 16:40
  • @Ezekiel - No! I should have pointed that out. Will edit.
    – bjb
    Commented Oct 26, 2023 at 20:33
  • I ask only because that would allow you to re-build your library with metadata by creating a new blank library and assigning it as your system library, causing it to sync to the cloud. But sounds like not an option.
    – Ezekiel
    Commented Oct 26, 2023 at 20:35

2 Answers 2

3
+50

As of May 2024, there still isn't a way to rebuild your Photos library the way I described in the question. HOWEVER, I did at least want to share some information which did help significantly for me.

The problem I had was that my faces recognition never completed, so after lots of poking around I realized that there were some corrupt database files in the library. So "your mileage may vary", but I did find that deleting some cache databases in the library did force Photos and the supporting analysis services to rebuild a lot of stuff and eventually I found that I achieved what I was looking for. Do note that this may take a week or two depending on the size of your library.

So there are a few directories with caches in them:

/Users/bjb/Pictures/Photos Library.photoslibrary/resources/caches
/Users/bjb/Pictures/Photos Library.photoslibrary/private/com.apple.photolibraryd/caches
/Users/bjb/Pictures/Photos Library.photoslibrary/private/com.apple.photoanalysisd/caches
/Users/bjb/Pictures/Photos Library.photoslibrary/private/com.apple.Photos/caches
/Users/bjb/Pictures/Photos Library.photoslibrary/private/com.apple.mediaanalysisd/caches
/Users/bjb/Pictures/Photos Library.photoslibrary/scopes/cloudsharing/caches

I removed ALL the files under the photoanalysisd and mediaanalysisd caches directories while Photos.app was not running and then rebooted.

While it did impact the operation of the application and others that source from Photos, it did go through the whole library again and rebuild the cache. This seems to have fixed the library and I didn't lose any metadata (that I'm aware of, at least). It took several days to complete and in the "People" section of the app, it did report how many photos were remaining to process; this didn't get stuck and eventually, everything was fine and working normally again.

Proceed with caution (i.e. backups) and as well I can't speak to the other caches directories, but I'd imagine the behavior is similar.

1
  • That is probably similar to what happens when you restore from Time Machine which doesn't backup files/folders which can be recreated.
    – Gilby
    Commented May 4 at 9:09
1

Apple says to quit Photos if it is open. Press Option-Command and double-click Photos. In Repair Library window, click Repair to rebuild your photo library.

2
  • "Apple says..." - do you have a link or reference? Commented May 3 at 18:39
  • Yeah, the "Repair Library" option was used as was a 3rd party product; neither of them achieved the fix I was hoping for. Unfortunately Apple doesn't publicly document what the repair function does, so it is a bit of a "crossing fingers" move.
    – bjb
    Commented May 4 at 21:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .