This module provides a method for migrating the users and taxonomy terms from an existing Drupal 8+ site to a fresh installation of a site with the same configuration (i.e., content types, taxonomy, etc.). This is useful for contexts where you want to drop all node data but retain user information in order to do a reimport of node data, or a migration of that data to a different data structure.
- It is the responsibility of the user to migrate all site configuration. The recommended way of achieving this is through configuration management.
- As a true installation + migration, artifacts such as database logs, State API data, or environment-specific configuration will not be reflected. Only that which is specified to be migrated will be migrated.
- Register a new database connection that you can use as the source. The following example shows a setup using lando, but the principle is the same for all local development:
In .lando.yml
:
services:
source_database:
type: mysql
In settings.php
:
$databases['migrate']['default'] = [
'database' => $lando_info['source_database']['creds']['database'],
'username' => $lando_info['source_database']['creds']['user'],
'password' => $lando_info['source_database']['creds']['password'],
'host' => $lando_info['source_database']['internal_connection']['host'],
'prefix' => '',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
];
- Import the source database
lando db-import source.sql.gz --host=source_database
- Install the site afresh using configuration IDs
lando drush si -y
lando drush config-get "system.site" uuid
lando drush config-set "system.site" uuid <value>
lando drush config-get "language.entity.en" uuid
lando drush config-set "language.entity.en" uuid <value>
lando drush cim -y
- Run the migration
lando drush en corpus_migrate -y && lando drush mim