Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bzrudi71’s picture

Many fails because of schema not found exceptions. May be fixed by #1060476: Multiple issues when PostgreSQL is used with non-public schema, so adding as related.

mradcliffe’s picture

Here's a patch that will expose test failures in Migrate Drupal by getting rid of the first exception. This prevents the schema generated by Drupal 6 from not working in PostgreSQL because of Drupal Schema types like "text" having explicit "not null" and "length" keys on table definitions. I think this patch needs work. I couldn't find any specification page listing supported types for not null or a way of deriving that information that is scalable.

This brings the next issue, which is something like the following:

Migration failed with source plugin exception: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "drupal8.simpletest447573migrate_map_d6_date_formats" does not exist LINE 4: LEFT OUTER JOIN drupal8.simpletest447573migrate_map_d6_date_... ^
Berdir’s picture

The map table sounds like the table auto-create problem again, they are dynamically created?

bzrudi71’s picture

Should we create sub-issues here, guess we can't handle all that within a single patch? BTW: SQLite doesn't do any better, please see SQLite Bot ;-)

amateescu’s picture

I just opened a sister issue for SQLite: #2454669: SQLite: Fix tests in migrate_drupal test group

bzrudi71’s picture

FileSize
112.04 KB
224.96 KB

I took some minutes to see how to move forward here. Attached is a quick patch that should expose the remaining fails and exceptions. It seems we just need to fix the "undefined table" problem and most errors should be gone. I included the workaround for SQLite from @amateescu, but that doesn't seem to work. So again, this is just to have an impression of the remaining fails, not sure when I will have the time to look again here (maybe next week) ;-)
Full test run and patch attached.

amateescu’s picture

Cross-posting my comment from #2477251-2: PostgreSQL: Fix Connection::getFullQualifiedTableName() because this issue has more followers.

Can someone please check if the patch over there in combination with the one from #2 above fixes those undefined table exceptions?

bzrudi71’s picture

Nice, with all the patches around we get very close to to 100% pass :-) The remaining hand full of fails are about NUT NULL constraints errors:
Drupal\Core\Entity\EntityStorageException: SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "name" violates not-null constraint DETAIL: Failing row contains (4, forums, en, null, null, null, 0, 1429955198, 1).: INSERT INTO simpletest370267taxonomy_term_field_data (tid, vid, langcode, name, description__value, description__format, weight, changed, default_langcode) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8); Array ( ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 929 of /opt/local/apache2/htdocs/drupal8/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Going to create separate issues now to have a better overview what is left to be done.

bzrudi71’s picture

Priority: Normal » Major
Issue summary: View changes

IS update

bzrudi71’s picture

bzrudi71’s picture

bzrudi71’s picture

bzrudi71’s picture

Just did a fresh bot run with all patches applied with very lovely results :-)

amateescu’s picture

Nice! Drupal\migrate_drupal\Tests\d6\MigrateDrupal6Test also (still) fails on SQLite, even though every migrade_drupal test passes individually :/

/me looks sideways at the funky code in Drupal\migrate_drupal\Tests\MigrateFullDrupalTestBase.

bzrudi71’s picture

Issue summary: View changes

Cool, #2477251: PostgreSQL: Fix Connection::getFullQualifiedTableName() is already committed, moving out of the way :-)

bzrudi71’s picture

@amateescu regarding the Drupal\migrate_drupal\Tests\d6\MigrateDrupal6Test, will that be fixed for PG too? I can't find any open SQLite issue for that?

amateescu’s picture

I'm not sure if it can be fixed for both db drivers at the same time, I haven't started to debug it yet. And there's no issue for SQLite currently, it's just documented as a failing test in #2454669-8: SQLite: Fix tests in migrate_drupal test group. I'll cross-post here if/when I have some updates on it :)

bzrudi71’s picture

mradcliffe’s picture

Component: postgresql db driver » migration system

I'm going to change component to migration system so it's in the migrate queue, and that will hopefully give this more eyes.

Berdir’s picture

Might be worth to test with/wait for #2258177: Convert migrate_drupal tests to KernelTestBase to land? It's RTBC and confirmed to fix all remaining sqlite related test fails.

bzrudi71’s picture

Just did a fresh migrate_drupal test run, now that #2258177: Convert migrate_drupal tests to KernelTestBase is in. Lovely, we can close:
- #2477857: PostgreSQL: Fix not null constraint exceptions in migrate_drupal tests and
- #2477945: PostgreSQL: Fix migrate_drupal\Tests\d6\MigrateUserProfileFieldTest

There is only one remaining fail related to taxonomy terms.

erik.erskine’s picture

I did some investigation into why Drupal\migrate_drupal\Tests\d6\MigrateTaxonomyTermTest is failing.

Not all taxonomy terms are being migrated - the taxonomy_term_data table has just 4 rows on PostgreSQL, whereas there are 6 on MySQL. It looks like this is down to the order in which they are processed during the migration. If we try to migrate a term for which the parent term has not yet been migrated, the child term is skipped. The order seems to vary between MySQL and PostgreSQL.

To illustrate this, adding orderBy('tid') to the query in Drupal\migrate_drupal\Plugin\migrate\source\d6\Term means that the parent terms are loaded first, and the tests to pass. However that's only true in this particular case, so it isn't a real solution, but may help with diagnosis.

bzrudi71’s picture

Issue summary: View changes

Cleanup!

bzrudi71’s picture

Issue summary: View changes
bzrudi71’s picture

Status: Active » Closed (fixed)

Marking as fixed as the remaining (two) issues are now handled within #2157455: [Meta] Make Drupal 8 work with PostgreSQL or remove support from core before release to have them in one place.