Skip to content

Import Existing

rhoopr edited this page Apr 30, 2026 · 7 revisions

import-existing

Scan a local directory and mark matching iCloud assets as already downloaded in the state database. The next sync skips these files instead of re-downloading them.

Usage

kei import-existing -u my@email.address -d /photos

This authenticates with iCloud, enumerates the library, then walks the download directory matching local files to remote assets by filename and size. Matched files are recorded as downloaded in the state DB.

When to Use

  • Migrating from Python icloudpd (or any other tool) that already downloaded your library
  • Recovering after a database reset when the files are still on disk
  • Adopting kei on a directory that was populated by another method

See Migration from Python for the full migration workflow.

Flags

Global flags (--username, --config, --data-dir, --domain, --log-level) apply to this command.

Flag Description
-d, --download-dir Local directory containing existing files (required)
--library Library to match against (default: PrimarySync, use all for all)
--folder-structure Folder template used when the files were downloaded
--keep-unicode-in-filenames Must match the setting used during the original download
--recent Only check the N most recent assets
--no-progress-bar Disable the progress bar
-p, --password iCloud password
--password-file Read password from a file
--password-command Run a command to get the password

The --folder-structure and --keep-unicode-in-filenames values need to match what was used to create the files on disk. If the folder layout doesn't match, files won't be found.

Related

Clone this wiki locally