Create migration of advanced settings from Drupal 7 to Drupal 10

Created on 31 January 2024, 10 months ago

Problem/Motivation

The Drupal 10 version of this module implements a lot of the same settings as the Drupal 7 version. In Drupal 7, these are stored in the variable table. In Drupal 10 these are stored in configuration.

There is a variable source plugin provided by the core Migrate Drupal module which we should be able to use in conjunction with the config destination plugin, provided by core migrate.

These in conjunction should produce something like this:

id: d7_auth0_advanced_settings
label: 'Auth0 Advanced Settings Migration'
migration_tags:
  - Drupal 7
  - Configuration
source:
  plugin: variable
  variables:
    - auth0_allow_signup
    - auth0_auto_register
    - auth0_claim_mapping
    - auth0_claim_to_use_for_role
    - auth0_form_title
    - auth0_join_user_by_mail_enabled
    - auth0_lock_extra_settings
    - auth0_login_css
    - auth0_requires_email
    - auth0_role_mapping
  source_module: auth0
process:
  auth0_allow_signup: auth0_allow_signup
  auth0_auto_register: auth0_auto_register
  auth0_claim_mapping: auth0_claim_mapping
  auth0_claim_to_use_for_role: auth0_claim_to_use_for_role
  auth0_form_title: auth0_form_title
  auth0_join_user_by_mail_enabled: auth0_join_user_by_mail_enabled
  auth0_lock_extra_settings: auth0_lock_extra_settings
  auth0_login_css: auth0_login_css
  auth0_requires_verified_email: auth0_requires_email
  auth0_role_mapping: auth0_role_mapping
destination:
  plugin: config
  config_name: auth0.settings

to provide a way for the advanced settings to transfer over from D7 to D10

Steps to reproduce

  1. Install Auth0 on a Drupal 7 site
  2. Add customizations to the ADVANCED settings tab
  3. Install Auth0 on Drupal 10
  4. Connect Drupal 7 database to Drupal 10 site
  5. Note that the settings are back to defaults in Drupal 10

Proposed resolution

Add a migration to move advanced settings from D7 to D10.

There are some settings which are no longer the same or are sensitive and thus shouldnt be stored in the source or destination database (client id/secret), but there are some which can be copied over. the list of variables/config names can be seen in the example migration yaml above.

Remaining tasks

  1. Add migration
  2. Add tests

User interface changes

n/a

API changes

n/a

Data model changes

n/a

πŸ“Œ Task
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dan612 Portland, Maine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024