- NAME
-
- gcloud artifacts docker upgrade migrate - migrate projects from Container Registry to Artifact Registry
- SYNOPSIS
-
-
gcloud artifacts docker upgrade migrate[--canary-reads=PERCENT] [--copy-only] [--from-gcr=GCR_HOST/PROJECT_ID] [--input-iam-policy-dir=DIRECTORY] [--last-uploaded-versions=N] [--max-threads=MAX_THREADS; default=8] [--output-iam-policy-dir=DIRECTORY] [--pkg-dev-location=PKG_DEV_LOCATION] [--projects=PROJECTS] [--recent-images=NUM_DAYS] [--skip-iam-update] [--skip-pre-copy] [--to-pkg-dev=PROJECT_ID/REPOSITORY_ID] [--no-use-analyze-iam] [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
- Migrate projects from Container Registry to Artifact Registry
- EXAMPLES
- To migrate a project
my-projectusing gcr.io repositories:gcloud artifacts docker upgrade migrate --projects = my-projectTo migrate several projects using gcr.io repositories:
gcloud artifacts docker upgrade migrate --projects = my-project1,my-project2,my-project3To migrate a project using pkg.dev repositories:
gcloud artifacts docker upgrade migrate --from-gcr = gcr.io/project1 --to-pkg-dev = project2/repo_name - FLAGS
-
-
--canary-reads=PERCENT - Send only a percent of reads to Artifact Registry. The rest of reads and all writes are sent to Container Registry.
-
--copy-only - Only perform image copying
-
--from-gcr=GCR_HOST/PROJECT_ID - Container Registry host + project to copy from. This flag is only used when migrating to pkg.dev repos. Example: gcr.io/my-project
-
--input-iam-policy-dir=DIRECTORY - During the IAM update step, the tool applies all iam policies in the given directory.
-
--last-uploaded-versions=N - Only copy the N most recently uploaded versions of each image. More than N images may be copied if new images are uploaded during migration.
-
--max-threads=MAX_THREADS; default=8 - Max number of images to copy simultaneously. Consider quota usage when increasing this
-
--output-iam-policy-dir=DIRECTORY - Outputs Artifact Registry-equivalent bindings to this directory during IAM update step and then exits the tool. After any neccesary modifications are made, the tool can be rerun with --input-iam-policy-dir to continue migration with the generated bindings.
-
--pkg-dev-location=PKG_DEV_LOCATION - The location of the pkg-dev repository you are migrating to. If not specified, migration is always done to the same multi-region as GCR. Setting this flag can cause cross-regional copying and lead to billing charges.
-
--projects=PROJECTS - Comma seperated list of Container Registry projects to migrate to Artifact Registry gcr.io repositories.
-
--recent-images=NUM_DAYS - Only copy images pulled or pushed in the last NUM_DAYS days. NUM_DAYS must be between 30 and 90 inclusive.
-
--skip-iam-update - Migrate without changing iam-policy. Users without Artifact Registry permissions will not have access to migrated images.
-
--skip-pre-copy - Skip the initial copy of recent images before enabling redirection.
-
--to-pkg-dev=PROJECT_ID/REPOSITORY_ID - Artifact Registry pkg.dev project ID and repository ID to copy to. Example: my-project/my-repo
-
--use-analyze-iam - Use analyzeIAMPolicy to get IAM bindings. If false, tooling iterates through IAM
bindings itself, which is slower, but doesn't require anlayzeIAMPolicy quota.
Enabled by default, use
--no-use-analyze-iamto disable.
-
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$ gcloud helpfor details. - API REFERENCE
- This command uses the
artifactregistry/v1API. The full documentation for this API can be found at: https://cloud.google.com/artifacts/docs/
gcloud artifacts docker upgrade migrate
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-27 UTC.

