Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
It's not easy to guess how to structure the Json file. I have try to run the import but it's keep to failed silently. I think it's something with my Json not being formatted properly.
Processed 0 items (0 created, 0 updated, 0 failed, 0 ignored) - done with 'test'
Proposed resolution
Document the json structure in the readme file.
Comments
Comment #2
raj45 CreditAttribution: raj45 commentedI agree, it would be great with a working example, like the one @heddn posted for Migrate Source CSV here: https://www.drupal.org/node/2570815#comment-10545764
Comment #3
raj45 CreditAttribution: raj45 at DBC commentedHere is a JSON example: https://github.com/heddn/d8_json_migrate
Comment #4
raj45 CreditAttribution: raj45 at DBC commentedComment #5
geerlingguy CreditAttribution: geerlingguy commentedDo we need to include an example in the module, or could we just point to one in documentation (either on the project page or in a dedicated docs page)?
Comment #6
geerlingguy CreditAttribution: geerlingguy commentedI've also written a quick (very simple) tutorial for basic use cases: Migrate a custom JSON feed in Drupal 8 with Migrate Source JSON.
Comment #7
targoo CreditAttribution: targoo at MariqueCalcus commented+1 on the tutorial
Comment #8
ressa CreditAttribution: ressa as a volunteer commentedThe JSON migrate example at https://github.com/heddn/d8_json_migrate still works fine, using these modules:
However, if I try to uninstall the module with
drush pmu d8_json_migrate -y
, I get this error:Comment #9
mchelen@geerlingguy IMHO linking to an example or tutorial from the project page would be fine for now, but I'd love to see the example included with the codebase for sake of consolidation & unified versioning.
Comment #10
ressa CreditAttribution: ressa as a volunteer commentedI agree with @Mike Chelen: to get an example included in the code base would ensure it gets updated and stays current. I recommend we use the example at https://github.com/heddn/d8_json_migrate - since it is a fully working example, except for the un-install, but that's a minor issue.
Comment #11
mchelenI've also made an incredibly simple example here: https://github.com/mchelen/migrate_acme/tree/json
Comment #12
mikeryanThis module has been superseded by the json parser plugin in migrate_plus and is no longer supported. There is a JSON example in the migrate_example module included with migrate_plus.
Comment #13
ressa CreditAttribution: ressa as a volunteer commentedThank you @mikeryan!
EDIT: For Drupal 8.6, see also Migrate JSON Example.