Creating an NA <-> EU migration option
I've spent some time adding functionality to allow bi-directional space transfer(s) between NA and EU data centers as this functionality doesn't currently exist.
How it works: contentful migrate datacenter --help ✔ at 18:35:19
migrate datacenter
Migrate a space between Contentful data centers
Options: -h, --help Show help [boolean] --source Source data center (na or eu) [required] [choices: "na", "eu"] --target Target data center (na or eu) [required] [choices: "na", "eu"] --source-space-id Source space ID [string] [required] --target-space-id Target space ID [string] [required] --environment-id Environment ID (e.g. master) [string] [default: "master"] --source-token Source CMA token [string] [required] --target-token Target CMA token [string] [required] --use-verbose-renderer Display progress in new lines instead of spinner [boolean] [default: false] --include-taxonomies Migrate taxonomies (Concepts & Concept Schemes) before importing content [boolean] [default: false] --source-org-id Organization ID where taxonomies should be exported from [string] --target-org-id Organization ID where taxonomies should be imported to [string] --skip-content-publishing Skips content publishing. Creates content but does not publish it [boolean] [default: false]
An example:
contentful migrate datacenter
--source na
--target eu
--source-space-id <spaceId>
--target-space-id <spaceId>
--source-token <PAT Token>
--target-token <PAT Token>
--source-org-id <orgId>
--target-org-id <orgId>
--include-taxonomies
--skip-content-publishing
I have manually tested this and it works both ways, it allows you to include taxonomies if you use them as otherwise the space import will fail, if you don't use them then you can simple use --include-taxonomies false
Wiz Scan Summary
| Scanner | Findings |
|---|---|
| Total |
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.
Hello @Chaffexd, thanks a bunch for investing the time to improve this tool. I left a couple non-blocking questions/suggestions but otherwise the code looks very clean and well tested.
After discussing with the Developer Experience PM, we have a couple thoughts around the name of the command migrate-datacenter. And while we fully acknowledge that we're bikeshedding here, we have 2 ideas we'd love your thoughts on:
- instead of using
datacenter, useregion. Contentful doesn't have physical datacenters, and conceptually I defer to the AWS regional model, where you can pick aregionlikeUS East (Northern Virginia) RegionorEurope (Frankfurt) Region. But if you think our customers would understand datacenter more easily, we're open to it. - instead of using
migration, usesync? There already exists the concept ofmigrationin the cli tool, which is a migration in the sense that data is being mutated. This PR is more exporting/importing data from different continents, but not making any changes to the underlying data.
Let us know what you think!
Lastly, this PR would really benefit from having a dedicated doc for the new command, similar to other commands have readme with basic descriptions/options/limitations.
:tada: This PR is included in version 3.8.10 :tada:
The release is available on:
Your semantic-release bot :package::rocket: