Problem/Motivation
We need to be able to import data from D6/D7 sites.
We will need different migrations/sources for D6/D7, possibly even for 7.x-1.x and 7.x-2.x due to the rather different data structure. We can also write a source plugin that supports both, though.
Proposed resolution
Start with one version. Define a source and a destination class and a migration config entity. We need at least a different migration for subscribers/subscriptions and newsletters. We might also want to separate subscribers and subscriptions, depends on how complicated the data processing will be.
There will be at least two sources as written above, both should provide the same data structurs, so we can use it with the same destination.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#10 | migrate-2596243-9-fix.patch | 6.14 KB | Arla |
| |||
#9 | migrate-2596243-9.interdiff.txt | 1.46 KB | Arla |
#9 | migrate-2596243-9.patch | 6.22 KB | Arla |
| |||
#6 | migrate-2596243-6.interdiff.txt | 4.51 KB | Arla |
#6 | migrate-2596243-6.patch | 6.23 KB | Arla |
|
Comments
Comment #2
ArlaComment #3
ArlaTo my understanding, the migration mechanisms are still experimental. I'm not really sure how they are intended to be used. But this is a start.
To perform the migration, install migrate_drupal (in core) and migrate_tools (part of migrate_plus), and run something like
drush migrate-manifest modules/simplenews/simplenews.manifest.yml --legacy-db-url=mysql://foo:bar@127.0.0.1/drupal7
.Newsletters are not yet supported, only subscriber entities.
Comment #4
ArlaMoved to migration_templates/, added newsletter. Drush usage remains the same.
Subscriptions and blocks are still to do.
Comment #5
ArlaSubscriptions are now basically migrated, but the target_id of subscriptions are exactly like newsletter_id, i.e. not considering the migration changes.
Comment #6
ArlaFixed the target_id processing. Then did some cleanup.
Now ready for review. So this migrates from 7.x-2.x to 8.x. I haven't even checked 7.x-1.x nor 6.x (yet) so I don't know what's different.
Check #3 on how to test this. I removed the manifest file, but you can easily create it as in the previous patches. I'm having problems with Xdebug+Drush, that's why I created the test controller in #5.
Comment #8
BerdirIsn't this an integer in 7.x? (type: serial)
Looks quite nice, but why the switch back to optional config instead of templates? Note that you're using old instructions, see https://www.drupal.org/node/2257723.
With the optional config, it then explodes on the missing database connection.
Comment #9
ArlaWell, it's tricky to find documentation on migration, and to know which pages are more up-to-date and correct.
Switched back to templates and the 'serial' type.
Comment #10
ArlaSorry, the patch in #9 contains a change to the subscriber template which doesn't seem to work I expect. Here's the one that should work.
Comment #11
BerdirOk, this works pretty well with 7.x-2.x.
To test, I went first to d8/upgrade, then went until the confirmation step. It reports that it can't find migrations for simplenews but that's just because the information there is hardcoded and it doesn't understand what belongs to which module.
Then, I used drush ms to see the list of migrations it created and drush mi d7_simplenews_newsletter/d7_simplenews_subscriber to run the specific migrations.
I think we can commit this as a first step, with a follow-up to also support 7.x-1.x (the biggest difference is that newsletters are a mix of terms + a custom table, so the source needs to detect that and run two different queries, ending up with the same data) and 6.x-* (same structure as 7.x-1.x, more or less, but different table names for term tables afaik).
Comment #13
BerdirCommitted, lets extend this to cover 6.x and 7.x-1.x too!
Comment #14
bisonbleu CreditAttribution: bisonbleu commentedHello, I have to migrate a website from Drupal 6 to Drupal 7 for a client. This website uses Simplenews. I've successfully used migrate and migrate_d2d for importing all content type data.
I'm not exactly sure how to proceed to migrate Simplenews data. This thread seems to address this issue but for Drupal 8.
Any ideas how I can do this?
Thanks!
Comment #15
hussainwebCreated #2802227: Define migrations for data from simplenews 7.x-1.x for migration from 7.x-1.x version of the module.
Comment #16
jonathanshawNow that this has been committed to 7.2, closing in favour of #2917919: Define migrations from D6 and #2802227: Define migrations for data from simplenews 7.x-1.x
Comment #17
rwmanos CreditAttribution: rwmanos commentedWhile migrating using drush migrate-upgrade a Drupal 7.56 site to Drupal 8.4.4 with simplenews-8.x-1.0-alpha3 installed, the following error occurs:
and the migration is interrupted.
Comment #18
jonathanshaw@rwmanos please create a new issue; you may also get better help on Drupal Answers.
Comment #19
ArlaComment #20
AdamPS CreditAttribution: AdamPS at AlbanyWeb commentedThis issue was fixed in #12. There are separate issues for follow on tasks as described in #16.