Problem/Motivation
I tried running a sample migration with a vanilla D6 site and got the following issue:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'd6-migrate.content_node_field' doesn't exist: SELECT cnf.field_name AS field_name, cnf.type AS type, cnf.global_settings AS global_settings, cnf.required AS required, cnf.multiple AS multiple, cnf.db_storage AS db_storage, cnf.module AS module, cnf.db_columns AS db_columns, cnf.active AS active, cnf.locked AS locked, cnfi.widget_type AS widget_type, cnfi.widget_settings AS widget_settings, map.sourceid1 AS migrate_map_sourceid1, map.source_row_status AS migrate_map_source_row_status FROM {content_node_field} cnf INNER JOIN {content_node_field_instance} cnfi ON cnfi.field_name = cnf.field_name LEFT OUTER JOIN migrate.migrate_map_d6_field map ON cnf.field_name = map.sourceid1 WHERE ( (map.sourceid1 IS NULL ) OR (map.source_row_status = :db_condition_placeholder_0) ) ORDER BY field_name ASC; Array ( [:db_condition_placeholder_0] => 1 )
This is because cck's content module is not enabled, thus the content_node_field table is unavailable. Also, this shuts down the migration process entirely and there's no coming back from such error.
Proposed resolution
Make it so the content_node_field table shouldn't have to be available when running the migration. Gracefully proceed to other available migrations in any case.
Remaining tasks
Write patch. Add test.
User interface changes
None.
API changes
None.
Data model changes
TBD.
Comment | File | Size | Author |
---|---|---|---|
#18 | 2561697-18-FAIL.patch | 5.37 KB | phenaproxima |
#18 | 2561697-18.patch | 5.72 KB | phenaproxima |
#16 | interdiff-2561697-12-16.txt | 496 bytes | phenaproxima |
#16 | 2561697-16.patch | 4.16 KB | phenaproxima |
#12 | interdiff-2561697-5-12.txt | 1.29 KB | phenaproxima |
Comments
Comment #2
anavarreComment #3
mikeryanComment #4
Jeremy CreditAttribution: Jeremy at Tag1 Consulting commentedAfter talking with mikeryan on IRC, adding "Migrate critical" tag as 'content' isn't a core D6 module.
Comment #5
phenaproximaDoes this help?
Comment #6
phenaproximaComment #7
anavarreApplied the patch but unfortunately it didn't seem to help.
Enabled the content module on the source D6 site:
And it worked immediately.
Comment #8
phenaproximaDang. Well, it was a shot in the dark...
@anavarre, can you provide a backtrace of the PDOException? That would help tremendously in figuring out what's wrong here. I suspect the fix is simple, but I need to know where to look :)
Comment #9
Jeremy CreditAttribution: Jeremy at Tag1 Consulting commentedComment #10
phenaproxima#8 ../core/modules/migrate/src/MigrationBuilder.php(53): Drupal\migrate_drupal\Plugin\migrate\builder\d6\CckMigration->buildMigrations(Array)
Oooh! I was really close. New patch comin' atcha today.
Comment #11
anavarreThanks for the stack trace, @Jeremy - You beat me to it. Will test the patch tomorrow if it's available. Thanks.
Comment #12
phenaproximaGive this one a try -- I doubt you will get the exception now.
Comment #13
anavarreSorry, still failing, but note that it's now yelling because content_node_field_instance doesn't exist.
Comment #14
anavarreComment #15
phenaproximaAccording to my debugging, the only reason you would be getting this error is if both of the following conditions exist in your D6 database:
1) The content module is listed in the system table and its status is 1;
2) The content_node_field and/or content_node_field_instance table(s) do not exist.
Otherwise, I don't see why it should be freaking out. The code responsible is pretty simple...
Comment #16
phenaproximaDebugged with @anavarre and found the source of the problem. I will be shocked, scandalized and chagrined if this does not fix the exception.
Comment #17
anavarreI can confirm #16 fixes the issue. Splendid!
Comment #18
phenaproximaNow with a test! Let's get this done.
Comment #20
phenaproximaFail patches fail. It's what they do.
Comment #21
anavarreAnd, passing now!
Comment #23
phenaproximaA fail patch failed testing, you say? Whatever shall we do? </sarcasm>
Comment #24
webchickGreat work on this one!
Committed and pushed to 8.0.x. Thanks!