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.
Now the Migrate has landed in core we need a migration example too.
Comment | File | Size | Author |
---|---|---|---|
#15 | interdiff-2182621-14-15.txt | 3.68 KB | amitgoyal |
#15 | migrate-example-2182621-15.patch | 28.59 KB | amitgoyal |
#14 | manifest_example.yml | 128 bytes | amitgoyal |
#14 | migrate-example-2182621-14.patch | 27.91 KB | amitgoyal |
Issue fork examples-2182621
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
claudiu.cristeaHere's a first attempt. Some notes:
Comment #2
marvil07 CreditAttribution: marvil07 commented@claudiu.cristea: It is a great start, thanks for the work!
Added to the main list at #1880976: [meta] Port examples (including submodules) to D9.4+.
Definitely something to add to examples. I would prefer to wait a little until the related patches arrive to core.
In the other hand, the patch now includes examples for:
It also includes some code to per-populate data into the database to be imported.
I remember migrate in D7 has some examples. Maybe it worths to also port some of the code there, i.e. to show that migration can import from i.e. xml or some other format.
I would suggest to ask this to the imp group, so we try to cover all of the migrate api with the least possible code :-)
I'll asking at the imp group post to follow the discussion here.
Thanks again to start this!
Comment #3
claudiu.cristeaYes, agree. I only wanted to start.
Sure. We have to look and port most important migrations and show cases here but this can be pushed in when sandbox work is in core. We can add new cases in the future.
Comment #4
claudiu.cristeaFixed also the 'body' field.
Comment #5
Mile23The idea is that eventually these examples will end up in core itself. So we have to use core docblock standards, and that means wrapping these lines. :-)
Also, classes like Base and Explode should declare that they're @ingroup migrate_example.
Lots of nice looking code. Just a few coding standards issues. But it's better to have it working and useable (and have IMP in core!) at this point.
Comment #6
claudiu.cristea@Mile23, thank you. Fixed.
Comment #8
claudiu.cristeaForgot to add '-do-not-test' suffix. The test failure is irrelevant till IMP is in core.
Comment #9
claudiu.cristeaAnd here's a writeup around this module http://webikon.com/cases/migrating-to-drupal-8
Comment #10
Mile23Comment #11
claudiu.cristeaentity_user
is nowentity:user
indestination:
of .yml. See http://drupalcode.org/sandbox/chx/2105305.git/commit/8ba48052384f5d616f0....Comment #12
Mile23I suppose this is the issue to watch: #2121299: Migrate in Core: Drupal 6 to Drupal 8
Correct?
Comment #13
hass CreditAttribution: hass commentedI'm highly interrested in real life examples and not only these minimal fake ones. See #2208967: Migration of setting that require changes? and try to write an example that migrate all update hooks from google_analytics 6xxx and 7xxx to 8xxxx. Make sure you can run every missing update hook independently if it has not run in past and make sure all of them run in correct order.
Comment #14
amitgoyal CreditAttribution: amitgoyal commentedReroll of #6 and #11.
I am able to migrate user roles and users successfully. Content migration runs without any errors but content is NOT being migrated.
I am using attached manifest file for the migration. Please see below the drush command output,
Can anybody explain how can I debug this issue?
Comment #15
amitgoyal CreditAttribution: amitgoyal commentedFinally content migration is also done as this was not working per #14.
Now the whole migration (user roles, users, content) is working as expected.
Comment #16
hass CreditAttribution: hass commentedCan we add an example how a contrib module can migrate a setting located inside user.data, please? e.g. user.data.example_foo
Comment #18
Mile23Comment #19
socketwench CreditAttribution: socketwench commentedSo, there's already a non-Drupal to Drupal 8 migration example in the migrate_plus module. There may be some merit in making a D7 or D6 to D8 example?
Comment #20
valthebaldMoving to new examples meta
Comment #21
ressa CreditAttribution: ressa at Ardea commentedI agree @socketwench. With the upcoming EOL of Drupal 7 later this year (November 2023) it would be awesome with an example migration from the standard Article content type, as well as a custom content type from Drupal 7 to Drupal 10, users, terms, etc.
It will come in handy.
Comment #22
jungle