ccswbs / hjckrrh

GNU General Public License v2.0
6 stars 5 forks source link

UG Migrate D6 - Implement Course Outlines Migration #488

Closed mmafe closed 8 years ago

mmafe commented 8 years ago

UG Migrate D6 - Implement Course Outlines Migration

mmafe commented 8 years ago

Tested locally. All fields are coming through.

course-d6-test-p1

course-d6-test-p2

mmafe commented 8 years ago

Status Update: Testing on develop with SOFAM data.

Received the following error:

WD php: PDOException: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'sourceid1' at row 1: INSERT INTO {migrate_map_ugcourseoutlinelevel6} (sourceid1,  [error]
needs_update, rollback_action, hash, destid1) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3,
:db_insert_placeholder_4); Array
(
    [:db_insert_placeholder_0] => 200 - Second Year
    [:db_insert_placeholder_1] => 1
    [:db_insert_placeholder_2] => 0
    [:db_insert_placeholder_3] =>
    [:db_insert_placeholder_4] => 28
)
 in MigrateSQLMap->saveIDMapping() (line 434 of /var/www/html/aoda.test.web.uoguelph.ca/aoda/sites/all/modules/migrate/plugins/sources/sqlmap.inc).
Cannot modify header information - headers already sent by (output started at                                                                                     [warning]
/var/www/html/aoda.test.web.uoguelph.ca/aoda/sites/uoguelph.ca.sandbox_mmafe/migrate_settings_d6.php:438) bootstrap.inc:1232
PDOException: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'sourceid1' at row 1: INSERT INTO {migrate_map_ugcourseoutlinelevel6} (sourceid1, needs_update, rollback_action, hash, destid1) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array
(
    [:db_insert_placeholder_0] => 200 - Second Year
    [:db_insert_placeholder_1] => 1
    [:db_insert_placeholder_2] => 0
    [:db_insert_placeholder_3] =>
    [:db_insert_placeholder_4] => 28
)
 in MigrateSQLMap->saveIDMapping() (line 434 of /var/www/html/aoda.test.web.uoguelph.ca/aoda/sites/all/modules/migrate/plugins/sources/sqlmap.inc).
Drush command terminated abnormally due to an unrecoverable error.  
mmafe commented 8 years ago

(4) Test and troubleshoot Course Outlines D6 classes [2]

mmafe commented 8 years ago

All regular mappings for SOFAM came through.

The error listed in the previous comments (ie. PDOException SQLState[01000] etc.) is specific to the field_syllabus_level mapping on SOFAM. The only difference that I can see between that field and the other text value fields is the presence of a space in the value (eg. 200 - Second Year).

Either way, none of these text fields that are mapped to taxonomies are coming through, nor at they meant to (non-taxonomy values do not map to taxonomy values).

mmafe commented 8 years ago

Workaround is available for situations where you have to map a text value into a taxonomy.

Do the following in the legacy database:

  1. Insert a vocabulary entry that corresponds to your field to the vocabulary table
  2. Add the terms for this new vocabulary entry into the term_data database (the vid will match your new vocabulary, and each entry should match each the name of each text value you are trying to map as a taxonomy. eg. 200 - Second Year would be a term to add to this table).
  3. Update the field text value (in the database for each row) to read the term ID instead of the termnames. E.g If your field syllabus level is contained in the field_syllabus_level_value column in the content_type syllabus table, you would update that value to read the term ID instead of "200 - Second Year"
  4. Retrieve the nid (node id), vid (revision id), and term ID for each row in the previous table. Insert this information into the term_node table.
  5. Update the migration so the source vocabulary for your field points to the newly created vocabularly ID.
  6. Re-run the migration
mmafe commented 8 years ago

I'm considering this tested and working. Will merge onto maint.

image


Demo of content migrated using manual workaround

image

mmafe commented 8 years ago

(3) Create Course Outlines D6 node, keyword, category, any other taxonomy migration classes [3]

mmafe commented 8 years ago

Merged onto maint.