Replies: 13 comments 38 replies
-
Try using --ramdb |
Beta Was this translation helpful? Give feedback.
-
Also, note that the label (computed by Photos) can change as Photos does more analysis on the library which can cause the metadata to be updated with |
Beta Was this translation helpful? Give feedback.
-
You might also want to store the export database on your local Mac using --exportdb Edit: if you do this you'll want to move the export database to the new location. |
Beta Was this translation helpful? Give feedback.
-
I update from MAC with SSD to a Synology NAS (no SSD) via 1Gbit with pretty much your parameters plus the ones referenced by RheTbull:
And for a ~90K Photos database it takes about 4 hours with smaller updates and around 5 hours if I have say ~200 new pics and videos. The wildcard is when Photos makes updates on things like labels (as mentioned) as it may be updating PS: I had a side issue which osxphotos would always export pics dats before 1970-01-01 as the NAS Synology would not record the date/time correctly... since then solved on the NAS by the newer versions. My logging times on my last runs... 6374275 [notice] --- Start Sun 28 May 2023 03:44:01 WEST p= 1 LONG=
2023-05-28 03:44:04.420476 -- osxphotos version: 0.59.3
2023-05-28 03:45:56.378065 -- Exporting 92661 photos to /Volumes/photo/XXX
2023-05-28 07:39:53.910683 -- Processed: 92661 photos, exported: 2007, updated: 313, skipped: 90343, updated EXIF data: 2320, missing: 0, error: 0, touched date: 326
2023-05-28 07:39:53.911315 -- Elapsed time: 3:53:57
2023-05-28 07:52:40.759952 -- Deleted: 10 files, 1 directory
[notice] Result: 0
6569002 [notice] --- End Sun 28 May 2023 07:54:13 WEST p.end= 0
6569003 [notice] --- Start Mon 29 May 2023 03:44:00 WEST p= 1 LONG=
2023-05-29 03:44:03.663441 -- osxphotos version: 0.59.3
2023-05-29 03:45:22.014169 -- Exporting 90651 photos to /Volumes/photo/XXX
2023-05-29 07:30:26.912168 -- Processed: 90651 photos, exported: 23, updated: 1852, skipped: 88778, updated EXIF data: 1875, missing: 0, error: 0, touched date: 953
2023-05-29 07:30:26.912802 -- Elapsed time: 3:45:05
2023-05-29 07:39:52.700939 -- Deleted: 2033 files, 0 directories
[notice] Result: 0
6759435 [notice] --- End Mon 29 May 2023 07:41:08 WEST p.end= 0
6759436 [notice] --- Start Sat 3 Jun 2023 03:44:00 WEST p= 1 LONG=
2023-06-03 03:44:04.930036 -- osxphotos version: 0.60.1
2023-06-03 03:45:26.032820 -- Exporting 90651 photos to /Volumes/photo/XXX
2023-06-03 08:05:59.588303 -- Processed: 90651 photos, exported: 5, updated: 710, skipped: 89938, updated EXIF data: 715, missing: 0, error: 0, touched date: 220
2023-06-03 08:05:59.589010 -- Elapsed time: 4:20:33
2023-06-03 08:15:49.050728 -- Deleted: 5 files, 0 directories
[notice] Result: 0
6944785 [notice] --- End Sat 3 Jun 2023 08:21:44 WEST p.end= 0
6944786 [notice] --- Start Sun 4 Jun 2023 03:44:00 WEST p= 1 LONG=
2023-06-04 03:44:05.201415 -- osxphotos version: 0.60.1
2023-06-04 03:45:31.476632 -- Exporting 90778 photos to /Volumes/photo/XXX
2023-06-04 07:27:23.836433 -- Processed: 90778 photos, exported: 127, updated: 92, skipped: 90561, updated EXIF data: 219, missing: 0, error: 0, touched date: 55
2023-06-04 07:27:23.837147 -- Elapsed time: 3:41:52
2023-06-04 07:37:39.049411 -- Deleted: 0 files, 0 directories
[notice] Result: 0
7129271 [notice] --- End Sun 4 Jun 2023 07:39:19 WEST p.end= 0
7129272 [notice] --- Start Sat 10 Jun 2023 03:44:00 WEST p= 1 LONG=
2023-06-10 03:44:16.600844 -- osxphotos version: 0.60.1
2023-06-10 03:45:12.573836 -- Exporting 90954 photos to /Volumes/photo/XXX
2023-06-10 08:53:03.976388 -- Processed: 90954 photos, exported: 430, updated: 1202, skipped: 89324, updated EXIF data: 1632, missing: 0, error: 0, touched date: 359
2023-06-10 08:53:03.977041 -- Elapsed time: 5:07:51
2023-06-10 09:00:59.446219 -- Deleted: 254 files, 0 directories
[notice] Result: 0
7317496 [notice] --- End Sat 10 Jun 2023 09:02:29 WEST p.end= 0 |
Beta Was this translation helpful? Give feedback.
-
This is what I got after running an update with a --profile: Exporting 111314 photos to /Volumes/photos/icloud export... Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) |
Beta Was this translation helpful? Give feedback.
-
re: Permission if doing the above as a scheduled job the following may be of some help: Privacy & Security sections: Files and Folders:
Full Disk Access:
Photos:
Further details at this discussion item |
Beta Was this translation helpful? Give feedback.
-
I've done some debugging on my end and it appears the "download missing" path is being called even if not required anytime the In the meantime, if you are using "keep originals on this Mac" you should have few if any missing photos so you should be able to run without |
Beta Was this translation helpful? Give feedback.
-
@MaxLyt Please update osxphotos to v0.60.2. I think you'll find the update speed is much improved as the "download missing" code path is no longer being called when files don't actually have to be downloaded. For my library, my update was taking 2 hrs 18 min on v0.60.1 and it now takes 0 hrs 47 min on v0.60.2 for 37,000 images. |
Beta Was this translation helpful? Give feedback.
-
Hello -- Noticed big slow down on export. All had been good speed wise on improvements discussed above up to v0.64.2 which I'd been using until 5 days ago when I upgraded to v0.67.2. At that point elasped time for the export has now gone up 3x-4x longer. I've now run it 4 times and it is staying around the 5.5-6 hr duration now for the export (used to be ~ 1 1/2 hrs using v0.64.2 and earlier). Thanks for any guidance ! Last run results: > osxphotos -v
> osxphotos export /Volumes/WDSSD2TB/photo_library_export/photo_library_backup/ --ramdb --download-missing --use-photokit --load-config /Volumes/WDSSD2TB/photo_library_export/osxphotos_backup.toml osxphotos, version 0.67.2
Python 3.12.1 (main, Dec 7 2023, 20:45:44) [Clang 15.0.0 (clang-1500.0.40.1)]
macOS 14.2.1, arm64
Exporting 210953 photos to /Volumes/WDSSD2TB/photo_library_export/photo_library_backup...
Exporting 210953 photos ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
Processed: 210953 photos, exported: 30, updated: 70, skipped: 263269, updated EXIF data: 0, missing: 75, error: 0
Elapsed time: 5:27:49
Cleaning up /Volumes/WDSSD2TB/photo_library_export/photo_library_backup
Deleted: 1 file, 0 directories Contents of config toml file used in export command above: /Volumes/WDSSD2TB/photo_library_export/osxphotos_backup.toml [export]
update = true
cleanup = true
report = "/Volumes/WDSSD2TB/photo_library_export/osxphotos_report_backup.sqlite"
append = true
db = "/Volumes/WDSSD2TB/Macbook_Pro_14_PhotosLibrary_Full_Originals_Backup/Photos Library.photoslibrary"
tmpdir = "/Volumes/WDSSD2TB/photo_library_export/osxphotos_tmp"
directory = "{created.year}/{created.year}-{created.mm}"
theme = "dark"
sidecar = [ "xmp",]
sidecar_drop_ext = true
person_keyword = true
favorite_rating = true
keyword_template = [
"Album: {folder_album}",
"{label}",
"{favorite?is_favorite}",
"is_{media_type}",
] |
Beta Was this translation helpful? Give feedback.
-
@MaxLyt I also export to NAS and did not notice this impact on the osxhotos version update as I use |
Beta Was this translation helpful? Give feedback.
-
Thanks. Is it possible to downgrade back to v0.64.2 and run the export with the profile turned on ? Kinda curious as to what might have caused the export to go up approx 73% in time to complete [ ~ 1hr35min on v64.2 vs 2hr44min on v67.3 ]. FYI - I do stop backup processes (Backblaze) while the export job is running so they don't impact the export job speed. Not a big deal though as it's a job that runs around 2am for me once a week. Thanks! |
Beta Was this translation helpful? Give feedback.
-
v0.64.3 with profile on took ~ 2hr3mins. Full details further below. Comparison of runs: ~ 2hrs 44min on 0.67.3 (NO profile) v0.64.3 with profile details: /Users/rajscode/Downloads/osxphotos -v
osxphotos, version 0.64.3
Python 3.11.6 (v3.11.6:8b6ee5ba3b, Oct 2 2023, 11:18:21) [Clang 13.0.0 (clang-1300.0.29.30)]
macOS 14.2.1, arm64 /Users/rajscode/Downloads/osxphotos --profile export /Volumes/WDSSD2TB/photo_library_export/photo_library_backup/ --ramdb --download-missing --use-photokit --load-config /Volumes/WDSSD2TB/photo_library_export/osxphotos_backup.toml > profile_v0_64_2_2024_01_18.txt
2024-01-18 13:54:10,587 - root - WARNING - photosdb.py - 151 - WARNING: This module has only been tested with macOS versions [10.12, 10.13, 10.14, 10.15, 10.16, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, 13.0, 13.1, 13.2, 13.3, 13.4, 13.5, 14.0]: you have Darwin, OS version: 14.2
Profiling...
Profile sort_stats order: ['cumulative']
Exporting 210985 photos to /Volumes/WDSSD2TB/photo_library_export/photo_library_backup...
Exporting 210985 photos ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
Processed: 210985 photos, exported: 0, updated: 2, skipped: 263424, updated EXIF data: 0, missing: 75, error: 0
Elapsed time: 2:02:26
Cleaning up /Volumes/WDSSD2TB/photo_library_export/photo_library_backup
Deleted: 27442 files, 0 directories
Profiling completed
10504430869 function calls (10200786536 primitive calls) in 7935.326 seconds |
Beta Was this translation helpful? Give feedback.
-
Wondering if something change in 0.67.4 vs prior release as it seems to have speed up quite significantly again. Didn't see anything in the release notes. Ran my standard weekly export job and it took only 1hr 26mins. I noticed the starting PROCESSING sequence prior to the EXPORTING portion seem to go much quicker vs 0.67.3 release (i.e. 1 min to get to the EXPORT vs ~ 5-7 mins to get to the EXPORT). UPDATE: Took a quick peek at the diff between 67.4 vs .3 and saw there are exportdb performance updates that were included. Also confirmed that my export database was upgraded. Export database version: 9.1, created by osxphotos version 0.67.4 ... (could it be useful to output to stdout anytime an upgrade is done to the export database. Otherwise one doesn't see that until the next time they run osxphotos export) Thx Latest osxphotos export Run Output Details
osxphotos, version 0.67.4 ---> Export Completed ... photos_library_export_to_disk_launchdjob scheduled job finished running. The job log at: /tmp/com.rajscodephotobackup.photos_library_export_to_disk_launchdjob.log.txt |
Beta Was this translation helpful? Give feedback.
-
I'm trying to use osxphotos to sync photos with a network storage. The initial sync worked very well, but updates take practically as much time as the initial sync. The library is stored locally on an external drive on a Mac and in iCloud (but iCloud synch does not work, so syncing via osxphotos, plus embedding metadata is a nice benefit!). Here is what I am doing:
osxphotos export '/Volumes/photos/icloud export' --directory '{created.year}/{created.month}' --force-update --cleanup --skip-original-if-edited --download-missing --touch-file --exiftool --exiftool-option -m --keyword-template '{label}' --exiftool-merge-keywords --exiftool-merge-persons --person-keyword --album-keyword --favorite-rating --exportdb '/Users/username/tmp/osxphotos_export.db'
It's a 110K file library but only about 100-300/week are added or updated. It took 10 hours for the initial export, which seems ok, but about 8 hours to update on a 10Gbit network with SSDs on both ends - seems slow. The goal is to keep a copy of the Photos library on a network drive, update files whenever file or metadata is changed, and delete files that are deleted in the master library.
Is there any way to speed up the updates?
I tried --only-new but that ends up deleting all previously exported files (oops) leaving literally only new ones :). My understanding is that --only-new without --cleanup will not remove any deleted files, and I'm not sure if it will update updated files. The documentation does not sound like it would.
I'm thinking if there is no full solution, I can do a workaround - run the slow update using the command line above weekly to monthly and running quick daily updates using the following:
osxphotos export '/Volumes/photos/icloud export' --directory '{created.year}/{created.month}' --force-update --only-new --skip-original-if-edited --download-missing --touch-file --exiftool --exiftool-option -m --keyword-template '{label}' --exiftool-merge-keywords --exiftool-merge-persons --person-keyword --album-keyword --favorite-rating --exportdb '/Users/username/tmp/osxphotos_export.db'
(w/o --clean-up but with --only-new).
Am I missing a better solution?
Beta Was this translation helpful? Give feedback.
All reactions