One of the biggest holes in the D6 to D8 migration path is the lack of support for reference fields. It's time to start the process. Rather than try to migrate everything in a single, huge, hard-to-review patch, I'd like to approach things piecemeal.

To that end, let's begin by migrating the field storage definitions for Drupal 6 node reference fields to D8 entity reference fields.

Comments

phenaproxima created an issue. See original summary.

phenaproxima’s picture

Status: Active » Needs review
StatusFileSize
new150.1 KB

Here's the initial patch, with test coverage.

Status: Needs review » Needs work

The last submitted patch, 2: 2872660-2.patch, failed testing.

phenaproxima’s picture

Issue tags: +Needs reroll
phenaproxima’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new149.97 KB

Status: Needs review » Needs work

The last submitted patch, 5: 2872660-5.patch, failed testing.

phenaproxima’s picture

Title: Migrate D6 node reference fields to D8 entity reference field storage config entities » Migrate D6 node reference fields to D8 entity reference field definitions
Status: Needs work » Needs review
StatusFileSize
new150.72 KB

Needed a reroll, apparently, and a little more love to the auxiliary D6 field migrations in order to pass the tests. This is all now done.

Status: Needs review » Needs work

The last submitted patch, 7: 2872660-7.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new154.38 KB
new4.43 KB

This should fix it! I also added support for migrating the field formatter setttings, plus test coverage of that.

phenaproxima’s picture

StatusFileSize
new15.45 KB

Here's a review-only patch that excludes the fixture changes.

heddn’s picture

Status: Needs review » Needs work
+++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldTest.php
@@ -84,36 +84,41 @@ public function testFields() {
+    // Test a node reference field.
+    $field_storage = FieldStorageConfig::load('node.field_company');
+    $this->assertInstanceOf(FieldStorageConfig::class, $field_storage);
+    $this->assertSame('node', $field_storage->getSetting('target_type'));

This is the ER field tests that I found. I think we should do some type check that the field is an ER field. Thanks for the review only patch. Makes it 10x easier to review.

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new155.62 KB
new1.71 KB

Good call. I have added that, plus some assertions about the field config entity as well.

phenaproxima’s picture

StatusFileSize
new16.7 KB

A review-only patch, to make the committers' lives easier.

heddn’s picture

Status: Needs review » Reviewed & tested by the community

Optimistically changing status. Let's hope it comes back green.

phenaproxima’s picture

Issue tags: +Migrate critical

Reference field migrations are one of the final missing pieces of the complete migration path from D6 and D7. I've discussed with the other Migrate maintainers in IRC and there is consensus that this is Migrate critical.

The last submitted patch, 12: 2872660-12.patch, failed testing.

  • catch committed 5380355 on 8.4.x
    Issue #2872660 by phenaproxima: Migrate D6 node reference fields to D8...

  • catch committed 0fee31c on 8.3.x
    Issue #2872660 by phenaproxima: Migrate D6 node reference fields to D8...
catch’s picture

Version: 8.4.x-dev » 8.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.4.x and cherry-picked to 8.3.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.