- Issue created by @DamienMcKenna
- π©πͺGermany jurgenhaas Gottmadingen
Nice to see that usecase. Not sure if I can be of much help here since I'm not sure about the former subscription data structure. I could certainly provide some feedback on how the subscription data is stored by DANSE, though. @DamienMcKenna let me know if and what you would need from our side, please.
- πΊπΈUnited States DamienMcKenna NH, USA
WIP source plugin.
<?php namespace Drupal\my_migrate_stuff\Plugin\migrate\source; use Drupal\migrate\Annotation\MigrateSource; use Drupal\migrate\Plugin\migrate\source\SqlBase; use Drupal\migrate\Plugin\MigrationInterface; /** * Migrate source for the Subscriptions data. * * @MigrateSource( * id = "d7_subscriptions", * source_module = "subscriptions" * ) */ class UserSubscriptions extends SqlBase { /** * {@inheritdoc} */ public function query() { $query = $this->select('subscriptions', 's'); $query->join('subscriptions_user', 'su', 's.recipient_uid = su.uid'); $query->fields('s', [ 'sid', 'module', 'field', 'value', 'recipient_uid', 'send_interval', 'author_uid', 'send_updates', 'send_comments', ]); $query->fields('su', [ 'uid', 'digest', 'secure_links', 'send_interval', // Ignore these two columns as they're duplicates for our use case. // 'send_updates', 'send_comments', 'send_interval_visible', 'send_updates_visible', 'send_comments_visible', 'autosub_on_post', 'autosub_on_update', 'autosub_on_comment', 'send_self', 'suspended', ]); $query->orderBy('s.sid'); print_r((string), $query); return $query; } /** * {@inheritdoc} */ public function fields() { $fields = [ 'sid' => 'sid', ]; return $fields; } /** * {@inheritdoc} */ public function getIds() { return [ 'sid' => [ 'type' => 'integer', 'alias' => 's', ], ]; } }
- πΊπΈUnited States DamienMcKenna NH, USA
Migration config for the "update" data:
id: mysite_users_subscriptions_update migration_group: mysite label: 'Users: Subscriptions: Update' audit: true migration_tags: - LBL - Users source: plugin: d7_lbl_subscriptions constants: type: 'content' subtype: 'taxonomy_term' operation: 2 publish: 'publish' update: 'update' process: # None of these values are used. # sid: sid # field: field # recipient_uid: recipient_uid # send_interval: send_interval # author_uid: author_uid # send_updates: send_updates # send_comments: send_comments # digest: digest # secure_links: secure_links # send_interval: send_interval # send_interval_visible: send_interval_visible # send_updates_visible: send_updates_visible # send_comments_visible: send_comments_visible # autosub_on_post: autosub_on_post # autosub_on_update: autosub_on_update # autosub_on_comment: autosub_on_comment # send_self: send_self # suspended: suspended uid: uid module: plugin: default_value default_value: 'danse' key: plugin: concat delimiter: '-' source: - 'constants/type' - 'constants/subtype' - value - 'constants/operation' - 'constants/update' settings: plugin: default_value default_value: 1 destination: plugin: user_data migration_dependencies: required: { } optional: { }
- πΊπΈUnited States DamienMcKenna NH, USA
Migration config for the "publish" data:
id: mysite_users_subscriptions_publish migration_group: mysite label: 'Users: Subscriptions: Publish' audit: true migration_tags: - mysite - Users source: plugin: d7_lbl_subscriptions constants: type: 'content' subtype: 'taxonomy_term' operation: 2 publish: 'publish' update: 'update' process: # None of these values are used. # sid: sid # field: field # recipient_uid: recipient_uid # send_interval: send_interval # author_uid: author_uid # send_updates: send_updates # send_comments: send_comments # digest: digest # secure_links: secure_links # send_interval: send_interval # send_interval_visible: send_interval_visible # send_updates_visible: send_updates_visible # send_comments_visible: send_comments_visible # autosub_on_post: autosub_on_post # autosub_on_update: autosub_on_update # autosub_on_comment: autosub_on_comment # send_self: send_self # suspended: suspended uid: uid module: plugin: default_value default_value: 'danse' key: plugin: concat delimiter: '-' source: - 'constants/type' - 'constants/subtype' - value - 'constants/operation' - 'constants/publish' settings: plugin: default_value default_value: 1 destination: plugin: user_data migration_dependencies: required: { } optional: { }
- πΊπΈUnited States rclemings
Is this still a work in progress or is it ready to use (more or less)?