Hello,

I'm in the process of finishing up a D6 upgrade to D7, and one remaining major task I have left is to migrate Coupons (and Gift Certificates). However I'm not quite sure what, if anything, needs to be done to make this happen. I'm pretty familiar with writing new Migrate classes for nodes->entities and the like (including products) but I'm not quite sure how to go about doing this with Coupons.

Any pointers are appreciated. Code examples (especially with regard to how to define the Destination) is even better. Thanks!

Comments

pcambra’s picture

I guess Commerce Migrate is the best source for examples on very similar things, hope you can contribute back your findings :)

Anonymous’s picture

The coupon types are just entities, so if you are familiar with writing migration classes for that, it should be no different than other types.

In my case, I used Feeds to import the coupons, but it could just as easily be done with Migrate. Just setup your coupon type(s) first, get them working with some test items, then write your migrate code to target that.

You probably do not need commerce_migrate since you're just using the entity adapter. Feel free to contact me if you need help.

Anonymous’s picture

especially with regard to how to define the Destination

You should use the drupalcontrib.org site for this. It has a list of the supported classes, their parameters, and "methods" (built-in functions) they contain:

http://drupalcontrib.org/api/drupal/contributions%21migrate%21includes%2...

The parameters are in your "__construct" sub-function, so take a look at MigrateDestinationEntity::__construct to see what the options are.

smccabe’s picture

Issue summary: View changes
Status: Active » Closed (fixed)

Marking as closed since this is 3 years old and Ryan provided some good information.