Moving a VCN Between Compartments
You can move a VCN from one compartment to another.
When you move a VCN, its associated VNICs, private IPs, and ephemeral IPs move with it to the new compartment. This changes the management of the resources with no changes to the routing of the traffic.
The VCN is moved immediately. Resources attached to the VCN are moved asynchronously and don't appear in the new compartment until the move is complete.
- Open the navigation menu, click Networking, and then click Virtual cloud networks.
- Find the VCN in the list, click the , and then click Move Resource.
- Choose the destination compartment from the list.
- Click Move Resource.
- If alarms monitor the VCN, update the alarms to reference the new compartment. See Updating an Alarm After Moving a Resource.
Use the network vcn change-compartment command and required parameters to move a VCN from one compartment to another.
oci network vcn change-compartment --compartment-id target-compartment-ocid --vcn-id vcn-ocid ... [OPTIONS]
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Run the ChangeVcnCompartment operation to move a VCN from one compartment to another.