2

I'm migrating a D6 site to D7.

There are several content types that have cck noderefenrce fields that use referenced views for content types that can be referenced.

When I run the migration, I get a field validation error:

Field validation error for field: field name: this post can't be referenced.

In the CLI, I've used --user=1 to see if it was a permissions problem, but no luck.

Has anyone experienced this? Any hints or suggestions?

10
  • Please post your migration class so we can take a look.
    – Aaron
    Sep 17, 2015 at 17:21
  • I'm using the Migrate module out of the box with configured field mappings and running the migrations from the cli. I only wrote one custom migration and that was for the files. Sep 18, 2015 at 14:57
  • The error is thrown in: migrate\plugins\destinations\entity.inc: field_attach_validate($entity_type, $entity); in static public function fieldAttachValidate($entity_type, $entity); Sep 18, 2015 at 15:57
  • What content type contains the node/entity reference? What content type does that reference point to? At the time the content containing the node reference is migrated has the migration for the content it's referencing already been run?
    – Aaron
    Sep 18, 2015 at 16:08
  • What content type contains the node/entity reference? It references a Multimedia content type. What content type does that reference point to? It points to a Multimedia node. At the time the content containing the node reference is migrated has the migration for the content it's referencing already been run? Yes. Thanks! I should add the nodereference field keeps the source node id of the node rather than the new node id after it has been migrated. Sep 18, 2015 at 16:14

1 Answer 1

0

It doesn't look like there's support for migrating nodereference fields in D2D migrate. You'll need to write a custom migrate class. In general, I haven't had much luck with the D2D GUI; it's only useful for super-simple migrations.

Writing a custom migration class (especially if you're using migrate_d2d) is really quite easy to do and a worthy exercise. Take a look at the migrate_d2d_example code. The nice thing is that migrate keeps track of the mapping between the old NIDs and the new so that you need only write one line of code in your constructor to ensure the reference field has the right value.

See: Migrate D6 node reference to D7 entityreference

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.