Skip to content

Running migrations

Available migrations

The module provides two migrations (via Migrate Plus):

Migration ID Description
crm_core_contact Migrates D7 CRM Core contacts into crm_contact entities (individual, household, organization).
crm_core_relationship Migrates D7 Relation rows (CRM relationships) into crm_relationship entities. Depends on crm_core_contact.

Run the contact migration before the relationship migration.

Running the migrations

From your Drupal application root:

drush migrate:status
drush migrate:import crm_core_contact
drush migrate:import crm_core_relationship

Use drush migrate:status to confirm both migrations are defined and to see their status (Idle, Importing, etc.).

Migrations not showing in migrate:status

Migration config in config/install/ is applied only when the module is first installed. If you enabled the module before that config existed (or reinstalled without the config), the migration definitions will not be in active configuration and drush migrate:status will list nothing.

Import the migration config from the module’s install directory. From your Drupal root:

drush config:import --partial --source=web/modules/contrib/crm_migrate_crm_core/config/install

Adjust the path if the module lives elsewhere (e.g. web/modules/custom/crm_migrate_crm_core). Then run drush migrate:status again.

Order and dependencies

  1. Ensure the D7 database connection is configured under the migrate key (see Installation).
  2. Run crm_core_contact first.
  3. Run crm_core_relationship second; it depends on migrated contact IDs.

For rollback:

drush migrate:rollback crm_core_relationship
drush migrate:rollback crm_core_contact