Running migrations

After:

  1. Create a Custom Module to tweak migrations.
  2. Generate Migration Templates with migrate_upgrade
  3. Write Custom Plugins
  4. See Migration status

It’s time to run those migrations, to import CT’s, fields, settings/configuration, etc…

Migrations order

Member Information CT

  1. rsync files from public:files on Prod to Local migrate env:

    rsync -avz /source/path/docroot/sites/default/files /dest/path/docroot/sites/default/

  2. IMPORTANT To avoid redirect problems, after syncyng files directories, comment out the content in sites/default/files/private/.htaccess file!

  3. Migrate Member Information CT as User Entity. See Member Information to User for detailed instructions.
  4. Migrate Profile Picture. See Migrate Profile Picture for detailed instructions.
  5. Migrate File Upload fields and update the User migration (so files ‘attached’ to nodes get attached in D8 nodes):

    drush mim upgrade_d6_upload --execute-dependencies

    drush mim acvo_d6_user_profile --execute-dependencies --update

Regular Content Types

After we successfully migrated and transformed the Member Information CT into a User Entity, its time to migrate the other regular Content Types.

We need to alter some Migrate plugins templates in order to exclude the Member Information CT and its fields, field instances, etc…

So first, we need to add a DB query condition into the relevant files.

  1. The condition for ‘fields’ queries is:

    1
    2
    // @todo: After migrating Member Information CT Explicitly exclude member_information CT fields.
    $query->condition('cnfi.type_name', 'member_information', '!=');
    

    And the files to check are:

    • core/modules/fields/src/Plugin/migrate/source/d6/FieldInstance.php
    • core/modules/fields/src/Plugin/migrate/source/d6/Field.php
    • core/modules/fields/src/Plugin/migrate/source/d6/FieldInstancePerFormDisplay.php
    • core/modules/fields/src/Plugin/migrate/source/d6/FieldInstancePerViewMode.php
  2. The condition for the Node query is:

    1
    2
    // @todo: After migrating Member Information CT Explicitly exclude member_information CT fields.
    $query->condition('n.type', 'member_information', '!=');
    

    And the file to check is:

    • core/modules/fields/src/Plugin/migrate/source/d6/Node.php
  3. The condition for NodeType source query is:

    1
    ->condition('t.type', 'member_information', '!=');
    

    And the File to Check is:

    • core/modules/fields/src/Plugin/migrate/source/d6/NodeType.php

Pretty obvious Note: The query condition should be added inside the public function query() { function, before the return, obviously.

  1. IMPORTANT related to fields migration: when field “global settings”” in D6 don’t have a “Maxium Lenght” set, fields get migrated as “string_long”, which is not the desired field format for text_texfields, so as a nasty workaround I’ve commented out that condition in core/modules/text/src/Plugin/migrate/field/d6/TextField.php

  2. We now need to import the fields and field instances:

    drush mim upgrade_d6_field_instance_widget_settings --execute-dependencies

    We will get 4 errors like The "nodereference_url" plugin does not exist. It’s ok to ignore those as we are going to manually tweak those fields after migration.

    source_ids_hash level message
    9eff8c5b7e868e87064cd1f12e15d1498b199c631e94207f5795b8d8a954e23e 1 The “nodereference_url” plugin does not exist.
    e691fce9c62e61b8066d8f3e2741ce985a587a1d8b542a4e2162571c33480033 1 The “nodereference_url” plugin does not exist.
    6bb174130714dc37279ff28e131f7b01b1c3f1269c0a84a2530f9d6d7cd83de5 1 The “nodereference_url” plugin does not exist.
    fdba8920212a91d155e02e1e948932da50646a81ac594e832bba922ffc897e49 1 The “nodereference_url” plugin does not exist.
    source_ids_hash sourceid1 sourceid2 destid1 destid2 destid3 destid4 source_row_status rollback_action last_imported hash
    6bb174130714dc37279ff28e131f7b01b1c3f1269c0a84a2530f9d6d7cd83de5 six_month_diplomate_1 field_auto_lastnamesd_ref NULL NULL NULL NULL 3 0 0
    9eff8c5b7e868e87064cd1f12e15d1498b199c631e94207f5795b8d8a954e23e six_month_diplomate_1 field_auto_email_ref NULL NULL NULL NULL 3 0 0
    e691fce9c62e61b8066d8f3e2741ce985a587a1d8b542a4e2162571c33480033 six_month_diplomate_1 field_auto_fnamesd_ref NULL NULL NULL NULL 3 0 0
    fdba8920212a91d155e02e1e948932da50646a81ac594e832bba922ffc897e49 six_month_resident_1 field_member_id NULL NULL NULL NULL 3 0 0
  3. We now need to migrate the field_formatter settings:

    drush mim upgrade_d6_field_formatter_settings --execute-dependencies

  4. We are going to import and update all (7) the CT’s:

    • ABVO Resident Species Case Log CT

    drush mim upgrade_d6_node_acvo_species_caselog_form --execute-dependencies --update

    • 2018 ABVO Certifying Examination Application

    drush mim upgrade_d6_node_exam_application --execute-dependencies --update

    • 2018 ABVO Certifying Examination Supervising Diplomate Form

    drush mim upgrade_d6_node_exam_application_sd --execute-dependencies --update

    • 2018 ABVO Provisional Resident Application

    drush mim upgrade_d6_node_res_application_prov --execute-dependencies --update

    • ABVO Resident Surgery Log

    drush mim upgrade_d6_node_resident_surgery_log --execute-dependencies --update

    • Six Month Program Evaluation form - Supervising Diplomate

    drush mim upgrade_d6_node_six_month_diplomate_1 --execute-dependencies --update

    • Six Month Program Evaluation Form - Resident

    drush mim upgrade_d6_node_six_month_resident_1 --execute-dependencies --update