Moving an Object Storage Bucket to a Different Compartment
Move an Object Storage bucket to a different compartment in your Oracle Cloud Infrastructure tenancy.
Use the oci os bucket update command and required parameters to move the bucket to a different compartment:
oci os bucket update --name bucket_name --compartment-id destination_compartment_ocid [OPTIONS]where
destination_compartment_ocidis the compartment OCID associated with the destination compartment for the bucket you're moving.For example:
oci os bucket update --name MyBucket --compartment-id ocid.compartment.oc1..exampleuniqueID { "data": { "approximate-count": null, "approximate-size": null, "auto-tiering": null, "compartment-id": "new_ocid.compartment.oc1..exampleuniqueID", "created-by": "ocid1.user.oc1..exampleuniqueID", "defined-tags": {}, "etag": "fe4fb648-8ddd-42eb-9732-d431aafac354", "freeform-tags": {}, "id": "ocid1.bucket.oc1..exampleuniqueID", "is-read-only": false, "kms-key-id": null, "metadata": { "department": "Finance" }, "name": "MyBucket", "namespace": "MyNamespace", "object-events-enabled": false, "object-lifecycle-policy-etag": null, "public-access-type": "NoPublicAccess", "replication-enabled": false, "storage-tier": "Standard", "time-created": "2020-06-22T19:04:05.879000+00:00", "versioning": "Disabled" }, "etag": "fe4fb648-8ddd-42eb-9732-d431aafac354" }For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Run the GetBucket operation with the
compartmentIDof the destination compartment to move a bucket to a different compartment.When accessing the Object Storage API, the bucket name is used with the Object Storage namespace name to form the request URL:
n/object_storage_namespace/b/bucket