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.
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
Comment #1
pcambraI guess Commerce Migrate is the best source for examples on very similar things, hope you can contribute back your findings :)
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedThe 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.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedYou 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.
Comment #4
smccabe CreditAttribution: smccabe as a volunteer and at Acro Commerce commentedMarking as closed since this is 3 years old and Ryan provided some good information.