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
•
19 Apr 2024
Extending a Contrib Module's Configuration in Drupal 10: A Case Study with Sitewide Alert
Extending the functionality of a contrib module in Drupal can enhance its usefulness without altering the original codebase. This article provides a step-by-step guide on how to add custom configuration options to an existing contrib module, using the sitewide_alert module as an example. We will...
Andrew Fletcher
•
18 Apr 2024
LogicException: Form errors cannot be set after form validation has finished
When receiving a logic error such asLogicException: Form errors cannot be set after form validation has finished. in Drupal\Core\Form\FormState->setErrorByName() (line 1104 of /var/www/html/project/core/lib/Drupal/Core/Form/FormState.php).This error "LogicException: Form errors cannot be set...
Andrew Fletcher
•
09 Apr 2024
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException
Adding a new service to a custom module and the following error greeted me:The website encountered an unexpected error. Try again later.
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "summaries.reference_node". in...