Download & Extend

Migrate integration & upgrade from *reference

Project:Relation
Version:7.x-1.x-dev
Component:Relation migrate
Category:task
Priority:normal
Assigned:slashrsm
Status:closed (fixed)

Issue Summary

It would be nice to have migrate integration. Attached patch implements destination handler. Would this better be in this module or in migrate_extras?

AttachmentSizeStatusTest resultOperations
relation_migrate_support.patch7.4 KBIdlePASSED: [[SimpleTest]]: [MySQL] 283 pass(es).View details

Comments

#1

Status:active» needs review

#2

A bit improved patch.

AttachmentSizeStatusTest resultOperations
1606404_migrate_integration_2.patch7.78 KBIdlePASSED: [[SimpleTest]]: [MySQL] 283 pass(es).View details

#3

Category:feature request» task

Amazing! Love it. How could I test this? And, could you write a simpletest? We have many tests that check for the existence of a module and continue if it is there.

#4

I could write an example. I can also write tests. I do not have much experience with this, so I'd need some help here. Mostly with selection of test cases.

#5

Well I have no idea what this would be useful for as I never worked with migrate myself :) but I am sure it's very useful. Can we use this for the reference update path perhaps...? And test that.

#6

Well I have no idea what this would be useful for as I never worked with migrate myself :) but I am sure it's very useful. Can we use this for the reference update path perhaps...? And test that.

#7

I believe we could use it for that... In which stage is reference migration right now?

To give you an idea about my use-case. I have a media portal, where they have premium content. To activate premium access you get so called "premium number", which are imported daily into Drupal. When user enters premium number system checks if exists and saves this as "activation". In old system is this just a simple table connecting user and premium number. In new system, beeing developed, we use commerce_product_key for numbers and connect them to users via relation ("activation" in our case).

#8

#9

slashrsm: can you post an example implementation of MigrateRelationendpointsHandler? I'm using your MigrateDestinationRelation patch and unclear how to map the endpoints array here. Thanks!

#10

Assigned to:Anonymous» slashrsm
Status:needs review» needs work

I finally found some time to work on this. As soon I have any noticeable progress I'll post a patch against 7.x-1.x.

Here is my development sandbox: http://drupal.org/sandbox/slashrsm/1672590

#11

Waiting for the patch. Exciting!

#12

I have already commited some things in my sandbox.

#13

Attached patch kinda implements migration plugins and migration of entityreference, user_reference, node_reference and taxonomy_term_reference fields into relation. It already implements a simple configuration form under admin/structure/relation/migrate.

What definitely still needs to be done:
- more comments, polishing, code standards, ...
- validation at configuration form (check if selected relation type supports source and destination entities at all)
- test

So please take this patch more as a demonstration and a request for feedback about basic concepts than a finished thing.

AttachmentSizeStatusTest resultOperations
1606404_migrate_integration_13.patch19.81 KBIdlePASSED: [[SimpleTest]]: [MySQL] 345 pass(es).View details

#14

Title:Migrate integration» Migrate integration & upgrade from *reference

#15

Hi slashrsm, this is looking very promising. I'm going to have a crack now at running a migration from CSV into Relation. Is there a handler written for the RelationEndpointsField? If not, how does that work?

#16

Unfortunatley not. I was thinking about the way to implement this, but I was unable to find a solution that would be flexible and general enough. Let me know if you have any ideas.

Anyway... I can be *really* easy implemented this way: http://drupalcode.org/sandbox/slashrsm/1672590.git/blob/refs/heads/maste...

#17

Some more work done. Now we have more validation on configuration form. The basic shape of the module is now done. We need tests. I think this is the right time to give comments about architecture, code or UI. I'd rather refactor things now than later, when we have all tests done.

Looking forward to get some feedback....

AttachmentSizeStatusTest resultOperations
1606404_migrate_integration_17.patch25.49 KBIdlePASSED: [[SimpleTest]]: [MySQL] 345 pass(es).View details

#18

Status:needs work» needs review

Some tests added. More to come. Let's see how they behave....

AttachmentSizeStatusTest resultOperations
1606404_migrate_integration_18.patch39.84 KBIdleFAILED: [[SimpleTest]]: [MySQL] 349 pass(es), 12 fail(s), and 4 exception(s).View details

#19

Status:needs review» needs work

The last submitted patch, 1606404_migrate_integration_18.patch, failed testing.

#20

Status:needs work» needs review

Some more tests and it passes locally. Let's try it....

AttachmentSizeStatusTest resultOperations
1606404_migrate_integration_20.patch44.78 KBIdleFAILED: [[SimpleTest]]: [MySQL] 349 pass(es), 12 fail(s), and 4 exception(s).View details

#21

Status:needs review» needs work

The last submitted patch, 1606404_migrate_integration_20.patch, failed testing.

#22

I think setUp is failing on testbot due to the missing modules. This is how it's done in relation.rules.test:

<?php
 
function setUp() {
   
parent::setUp('relation');
   
// While setUp fails for non-existing modules, module_enable() doesn't.
   
module_enable(array('rules'));
  }
?>

#23

Status:needs work» needs review

THX for the tip. Let's see if this fixes it.

AttachmentSizeStatusTest resultOperations
1606404_migrate_integration_23.patch44.95 KBIdleFAILED: [[SimpleTest]]: [MySQL] 349 pass(es), 12 fail(s), and 4 exception(s).View details

#24

Status:needs review» needs work

The last submitted patch, 1606404_migrate_integration_23.patch, failed testing.

#25

Status:needs work» needs review
AttachmentSizeStatusTest resultOperations
1606404_migrate_integration_25.patch44.95 KBIdleFAILED: [[SimpleTest]]: [MySQL] 355 pass(es), 2 fail(s), and 0 exception(s).View details

#26

Status:needs review» needs work

The last submitted patch, 1606404_migrate_integration_25.patch, failed testing.

#27

Status:needs work» needs review

Still passes locally. Let's try again.

AttachmentSizeStatusTest resultOperations
1606404_migrate_integration_27.patch44.92 KBIdleFAILED: [[SimpleTest]]: [MySQL] 355 pass(es), 2 fail(s), and 0 exception(s).View details

#28

Status:needs review» needs work

The last submitted patch, 1606404_migrate_integration_27.patch, failed testing.

#29

Status:needs work» needs review

Let's try this....

AttachmentSizeStatusTest resultOperations
1606404_migrate_integration_29.patch44.95 KBIdleFAILED: [[SimpleTest]]: [MySQL] 355 pass(es), 2 fail(s), and 0 exception(s).View details

#30

Status:needs review» needs work

The last submitted patch, 1606404_migrate_integration_29.patch, failed testing.

#31

Status:needs work» needs review
AttachmentSizeStatusTest resultOperations
1606404_migrate_integration_31.patch45.24 KBIdlePASSED: [[SimpleTest]]: [MySQL] 355 pass(es).View details

#32

Move the test into the relation_migrate.info and then we can commit this , and the dependencies will be picked up by the bot on dev release.

#33

OK. I did that and I also fixed some whitespace issues.

All tests pass locally. I only get one exception, which apparently happens in migrate, so I can do nothing about it. See the attached image....

AttachmentSizeStatusTest resultOperations
test_pass.png2.32 MBIgnored: Check issue status.NoneNone
1606404_migrate_integration_33.patch45.71 KBIdlePASSED: [[SimpleTest]]: [MySQL] 355 pass(es).View details

#34

Status:needs review» fixed

Committed, let's see what the test bot thinks about it. Thanks slashrsm

#35

Great. Thanks to everybody that helped with this.

Would it be reasonable to add "Relation migrate" under component drop-down?

#36

Component:Miscellaneous» Relation migrate

done :)

#37

Great!

#38

Status:fixed» closed (fixed)

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