Moving an Artifact Registry Repository to a Different Compartment

Move an Artifact Registry repository from one compartment to another.

After you move a repository a new compartment, the policies that govern the new compartment apply immediately and affect access to that repository. For more information, see Managing Compartments.

    1. Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Artifact Registry.
    2. Under List scope, choose the compartment that contains the repositories.
    3. Click the name of the repository that you want to move.
    4. Click Move Resource.
    5. Choose the destination compartment.
    6. Click Move Resource.
  • To move a repository into another compartment, use the artifacts repository resource, referenced in Artifact Registry CLI.

    Get all the commands for artifacts repository:

    oci artifacts repository -h

    Get help for the change-compartment command:

    oci artifacts repository change-compartment -h

    Find the options to provide for the change-compartment command:

    • --repository-id
    • --compartment-id

    Change the compartment of a repository:

    oci artifacts repository change-compartment --repository-id <repository-OCID> --compartment-id <destination-compartment-OCID>

    Example:

    oci artifacts repository change-compartment --repository-id ocid1.artifactrepository.oc1..xxx... --compartment-id ocid1.compartment.oc1..xxx...
  • Use the ChangeRepositoryCompartment operation to move a repository to another compartment.