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 #
    export target_compartment_id=target_compartment_ocid #
    oci iam compartment move --compartment-id compartment_ocid --target-compartment-id target_compartment_ocid

    For a complete list of flags and variable options for CLI commands, see the Command Line Reference.

  • Run the MoveCompartment operation to move a compartment.