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.
Attached is a simple patch to includes/migrate/plugins/destinations/og_membership.inc that adds a rollback function so that you can rollback membership imports from the migrate module. I've tested it using a couple different OG migrations.
Comment | File | Size | Author |
---|---|---|---|
og_membership.patch | 840 bytes | smichel | |
Comments
Comment #1
amitaibuYes, this exists in Migrate-extra as-well. What is the use case for this rollback?
Comment #2
smichel CreditAttribution: smichel commentedI'm doing some membership migrations separately from node and user migrations, and have some added fields that I'm testing (and og roles). I use migrate-import to bring the memberships in, then migrate-rollback to get rid of them. The memberships are deleted of course when users and nodes are deleted, but being able to roll back individual migrations is essential.
Comment #3
amitaibuCorrect status.
btw, Do we really need this -- isn't it just for timing actions?
Comment #4
smichel CreditAttribution: smichel commentedCould be that migrate_instrument_start & _stop aren't needed. Besides timing, it monitors memory consumption, it looks like. I know memory monitoring has been enormously useful to me in large migrations; I don't recall seeing it used on rollbacks.
Comment #5
amitaibuPlease keep the status as is.
Comment #6
smichel CreditAttribution: smichel commentedSorry, didn't mean to change the status.
Comment #7
amitaibu> I don't recall seeing it used on rollbacks.
Me as-well. I've removed it and committed. Thanks.