Skip to content

[Feature Request] Google Takeout "Locked Folder" import to Immich's "Locked Folder" #945

Open

Description

@starbuck93

Hello! With the introduction of the Locked Folder in v1.133.0 of Immich, I would love to see immich-go either automatically put the Google Photos takeout "Locked Folder" into Immich's locked folder or have a flag to only do the Locked Folder Takeout import. (For example, I don't need to import all of the assets from my Takeout data again)

It appears that Immich's API call for upload-asset has a visibilty param that now can be "locked"

I'm not experienced in go, but I hope it's straightforward as adding:

callValues["isLocked"] = myBool(la.Locked).String()

Activity

  1. itniels commented on May 26, 2025

    @itniels

    I am currently moving from Google Photos as well and see this issue where my locked folder files are just in the Photos, and with 10k photos it will take time to find them all and lock them again 😅

  2. starbuck93 commented on May 26, 2025

    @starbuck93
    Author

    @itniels I was able to get something working, but again, I have no experience in Go, so I'm scared to do a pull req for the feature!

    starbuck93/immich-go

  3. simulot commented on Jun 28, 2025

    @simulot
    Owner

    I have checked the takeout content for locked photos.
    The metadata file contains this field.

      "inLockedFolder": true,
  4. YoshiWalsh commented on Sep 28, 2026

    @YoshiWalsh

    For anyone else who did the import and then found out this feature didn't work afterwards, I'm going to document the steps I took to move my already-imported photos to the locked folder. I'll warn you, this isn't a polished process, I only needed to do it once so it's a kludge that was good enough for me.

    You will need:

    • jq
    • fish shell
    • immich-rest-cli
    1. Configure authentication for immich-rest-cli.
      NOTE: If you're using API key authentication, if Fix for authentication schemas after the first one not being considered shivaam/openapi-cli-gen#1 has not yet been merged you'll need to manually apply it.
      NOTE: If you're using API key authentication, if Update instructions for Immich API key authentication shivaam/openapi-cli-gen#2 has not been merged yet you should follow the updated documentation from that PR.

    2. From your takeout zip files, get a list of all original paths including Locked Folder:

    # Adjust for your filenames / however many zip files you have
    zipinfo takeout-20260924T100934Z-1-001.zip | grep Locked > lockedFiles.txt
    zipinfo takeout-20260924T100934Z-1-002.zip | grep Locked >> lockedFiles.txt
    zipinfo takeout-20260924T100934Z-1-003.zip | grep Locked >> lockedFiles.txt
    zipinfo takeout-20260924T100934Z-1-004.zip | grep Locked >> lockedFiles.txt
    1. From the paths, extract the filenames
    cat lockedFiles.txt | grep -v ".json" | sed -e "s/.*\///" > lockedFileNames.txt
    1. From the filenames, find the Immich asset IDs
      NOTE: This part is SLOW, it takes ~2 seconds per image. This is due to Cache CLI once built shivaam/openapi-cli-gen#3.

    getLockedAssetIds.fish:

    #!/usr/bin/fish
    
    while read -la filename
        set asset_id $(immich-rest-cli search assets --original-file-name "$filename" | jq -r ".assets.items[0].id")
        echo $asset_id >> assetIds.txt
    end < lockedFileNames.txt
    chmod +x getLockedAssetIds.fish
    cat lockedFileNames.txt | ./getLockedAssetIds.fish
    1. Move the assets to the Locked Folder (this part is nice and fast)
    immich-rest-cli assets update-assets --root $(cat assetIds.txt | jq -Rsc '{"ids": . | split("\n") | map(select(. | length > 0)), "visibility": "locked"}')
  5. AetherUnbound commented on Oct 13, 2026

    @AetherUnbound

    Thanks so much @YoshiWalsh, that saved me!! I followed those steps pretty closely, although here's what that script ended up looking like for me in bash:

    #!/usr/bin/env bash
    set -euo pipefail
    export IMMICH_REST_CLI_BASE_URL="http://localhost:2283/api"
    export IMMICH_REST_CLI_API_KEY=[redacted]
    while IFS= read -r filename || [ -n "$filename" ]; do 
        asset_id=$(immich-rest-cli search assets --original-file-name "$filename" | jq -r '.assets.items[0].id')
        echo "Found $asset_id for $filename"
        echo "$asset_id" >> assetIds.txt
    done < lockedFileNames.txt

    I also had to install the immich-rest-cli using the following, because otherwise it would break:

    uv tool install immich-rest-cli --with "pydantic==2.13.3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions