Andrew Fletcher published: 8 October 2022 (updated) 26 October 2022 1 minute read
Working through and importing JSON data into a content type.
Drush migration commands
Check the status of the migration data
lando drush migrate-status
Reset the migration status
lando drush migrate-reset-status migratable_riverdata_json
Import JSON data
lando drush migrate-import migratable_riverdata_json
Rollback to before the import
lando drush migrate-rollback migratable_riverdata_json
Errors
What to do when a migration fails? You will see a response similar to
lando drush migrate-import migratable_basic_content_json
3/3 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
[notice] Processed 3 items (0 created, 0 updated, 3 failed, 0 ignored) in 1.1 seconds (162.7/min) - done with 'migratable_basic_content_json'
In MigrateRunnerCommands.php line 458:
migratable_basic_content_json migration: 3 failed.
The details in this are scant and offer no value. To do so, you will need to get the migrate messages.
lando drush migrate:messages
If you have the following response
Not enough arguments (missing: "migrationId").
You are missing your id. In the example above, I need to use migrate able_basic_content_json
lando drush migrate:messages migratable_basic_content_json
Response
------- --------------------------------------- ------------------- ------------------------------------------------------------------------
Level Source ID(s) Destination ID(s) Message
------- --------------------------------------- ------------------- ------------------------------------------------------------------------
1 Day 2 - Breakout session 3 livestream migratable_basic_content_json:field_tags:explode: NULL is not a string
1 Subscription test migratable_basic_content_json:field_tags:explode: NULL is not a string
1 Subscription test - Media migratable_basic_content_json:field_tags:explode: NULL is not a string
------- --------------------------------------- ------------------- ------------------------------------------------------------------------
Now we know what the issue is and where to focus attention.
Related articles
Andrew Fletcher
•
07 Jan 2025
Resolving Twig syntax errors in Drupal
The release of Drupal 10.4.0 sees stricter validation rules being applied to Twig templates, which can result in unexpected errors after an upgrade. One such issue involves the use of regular expressions within Twig's matches operator, leading to syntax errors that can break template rendering.This...
Andrew Fletcher
•
05 Jan 2025
A comprehensive guide to debugging and monitoring in Drupal like a pro
Observing colleagues work with Drush, it’s clear they have the basics down pat. Recently, I conducted a crash course in upskilling like a pro. Moving beyond the frequent commands many have already mastered, such as:drush cr
drush updb
drush statusThese commands are fantastic for quick tasks like...
Andrew Fletcher
•
26 Nov 2024
A technical journey to resolving line ending issues in Drupal installations
In the ever-evolving landscape of web development, technical challenges are par for the course. One such challenge recently encountered involved a Drupal installation, where the popular command-line tool Drush failed to execute correctly. This article delves into the issue, the diagnostic steps...