Transition from monolith to headless
Most of our projects aren't built from scratch. Instead, we work for established businesses to transform their current online presence to fit the newest trend in an ever-changing digital environment. We face dealing with tons of data from various sources and look for ways to organize them.
Kentico Cloud is an excellent place for your data to live in the omnichannel world. Whereas up till now, we’ve had to compose content manually in its administration interface, with the new Content Management API and our new open-source Migration tool, we can now migrate data from any source to Kentico Cloud with ease.
While the Kentico Cloud CM API gives you fine-grained control over the migration process, the new Migration tool makes the use of CM API more straightforward, like performing bulk-imports in just one request.
Let’s see what this means from a technical viewpoint.
The Migration tool is an open-source Node.js application available on GitHub. The tool imports data to your Kentico Cloud project based on:
- Project ID
- Content Management API key
- Import data in JSON or CSV formats
You can try it right away in our testing instance or run it on your machine by forking the repository.
If you decide to have the tool installed locally, make sure you have Node.js installed. Then, in the project folder, run the following commands to install all dependencies and start the server:
- npm install
- npm start
The tool is now available at the following URL:
Interfaces for editors and programmers
The Migration tool comes in 2 flavors for how we can use it:
- A Graphical interface
- An API endpoint interface
The graphical interface has been designed to make the migration process straightforward. You just provide information to authorize the migration process and data you’d like to import. During the process, you can see can see its current state in the Logs area of the interface.
The endpoint interface is intended to be used programmatically to enable advanced scenarios by being integrated directly into the code of your application.
Migration data format
To migrate data successfully, you need to follow the predefined JSON or CSV structure and fit your content in it. As the structure might look complicated, the Migration tool allows you to generate a blueprint based on a selected content model. The Migration tool supports all the Kentico Cloud content elements.
Let’s demonstrate how the tool works in a simple scenario.
Example of use
We have the existing Dancing Goat website implemented in Kentico CMS. There are articles we’d like to migrate to our Kentico Cloud project. To keep the example simple we’ll migrate just the titles and summaries of the articles. To do this, we’ll take the following steps:
- Create a new content model in our Kentico Cloud project.
- Generate a blueprint for the migration data.
- Fill the blueprint with data from Kentico CMS.
- Migrate the data using the Migration tool.
Create a new content model in our Kentico Cloud project
As we know, we’d like to migrate article titles and summaries. We create a new content model with the corresponding content elements.
Generate a blueprint for the migration data
We need to know what structure the migration should have to import the articles successfully.
- Go to the Migration tool graphical interface.
- Fill in the Project ID of your Kentico Cloud project.
- Select the Article from the Content model selector.
- Generate the blueprint.
Populate the blueprint with data from Kentico CMS
This step may differ by source of content. In our case, we are migrating articles from Kentico CMS. So we create a new page with the Repeater web part and transformation based on the blueprint from the previous step. See detailed articles about migrating pages or UniGrid data from Kentico CMS to Kentico Cloud.
Migrate data using the Migration tool
Go back to the Migration tool, paste in the Content Management API key and replace the blueprint with the ready-to-import data from Kentico CMS. Then just hit the "Import data" button and watch the logs. Once the migration process is successfully finished, you can see the new content items in the content inventory of your Kentico Cloud project. If the process fails, the tool gives you a corresponding error message.
Let the digital transformation happen
Sooner or later, all businesses will appreciate the importance of the API-first CMS that allows them to engage with more customers with less effort. In such a revolutionary transformation, the new CM API and our Migration tool will undoubtedly come in handy. Be sure to give it a try!
We love getting your feedback! Do you like the new API and the Migration tool? Do you have any suggestions as to how to make the import process even smoother? The Migration tool is a living thing. Don’t hesitate to use it in your projects. And remember, the GitHub repository is at your service!