Smoothly Migrate your Enterprise CMS to Drupal using JSON API

What is migration?
If you want to use Drupal as a CMS over your existing proprietary or open source CMS, then you’ll have to go through the migration process.

The Drupal community provides an excellent framework called “Migrate” to simplify migration processes. The Migrate framework provides multiple ways to migrate source content into your Drupal site. JSON source migration is one of the most powerful methods of migration.

How is JSON migration better than any other migration method?
With the traditional method, we used to migrate content using a CSV file, which required a lot of tasks to be completed before source mapping, e.g:

CSV cleanup

Create a database using CSV file

Create a connection with source database

Write SQL queries to pull data from database (for this, you must have good skills in writing database queries)

Only after doing all this can we go ahead with migration steps, like field mapping, etc. This sounds like a big pain!

I’ve been thinking constantly about the future of Drupal migration without interacting with SQL, and having random off-and-on conversations with a few lead developers in my circles. I’d like to share my experience with JSON source migration, which helped me save a lot of time and effort in site migration.

How does JSON source migration help?
For JSON migration, we only need a JSON source URL. That’s it!

Let me show you how!

Prerequisite
Install the Migrate module from here: https://www.drupal.org/project/migrate
In this tutorial we’ll be creating a custom migration module to handle the migration process. In my case, I’ll be migrating movies from the JSON source to my Drupal movies content type, where I’ll be importing data into some text fields, taxonomy terms and an image field.

Conclusion
Using JSON API migration, you don’t need to worry about data structure as JSON already provides data in a structured way. Also, you don’t need to worry about SQL skills, which would be required in the case of database migration to pull data from the source database in a structured way, so that it can be migrated without errors or broken data. JSON migration also saves you from having to write a lot of code—you just need a source URL and you’re good to go.