Moving a Compartment

Move a compartment in an IAM tenancy.

To move a compartment, you must belong to a group that has manage all-resources permissions on the lowest shared parent compartment of the current compartment and the destination compartment.
    1. Open the navigation menu and click Identity & Security. Under Identity, click Compartments.

      A list of the compartments that you have access to in the tenancy is displayed. If the compartment you want to move isn't directly beneath the root compartment, click through the hierarchy of compartments to find the compartment.

    2. For the compartment you want to move, click the Actions menu (Actions Menu), and then select Move Resource.
    3. Select the destination compartment.
    4. Confirm that you're aware of the implications of the move.
    5. Click Move Resource.
  • Use the move command and required parameters to move a compartment:

    export compartment_id=compartment_ocid # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/iam/compartment/move.html#cmdoption-compartment-id
    export target_compartment_id=target_compartment_ocid # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/iam/compartment/move.html#cmdoption-target-compartment-id
    oci iam compartment move --compartment-id compartment_ocid --target-compartment-id target_compartment_ocid
    

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the MoveCompartment operation to move a compartment.