When using the wizard, and import is about to start, a ConnectionNotDefinedException is raised, and execution is interrupted. Basically Migrate seems to be looking for a database, when we do not need any here since the source is an XML file. Is this somehow triggered by Wordpress Migrate, or is it strictly a bug from in the Migrate module? How could we fix it, is there a workaround?

CommentFileSizeAuthor
#2 stack.txt3.56 KBFMB
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

caw67 created an issue. See original summary.

FMB’s picture

Title: doesnt work » Wordpress Migration UI dies with a ConnectionNotDefinedException when import starts
Assigned: caw67 » Unassigned
Priority: Normal » Major
Issue summary: View changes
Related issues: +#2700693: [meta] Make MigratePluginManager::getDefinitions() work cleanly with migrate_drupal enabled, +#2830036: MigrationPluginManager::getDefinitions() blows up in node derivers
FileSize
3.56 KB

Updated issue summary. Wordpress Migrate appears to be non-functional at the current time: can this be fixed in this module, or do we have to wait until it is fixed in the Migrate module itself (see related issues)? Attached the call stack at the time of the crash (please note that the patch from #2700693: [meta] Make MigratePluginManager::getDefinitions() work cleanly with migrate_drupal enabled was applied, so a RequirementsException is raised instead of a ConnectionNotDefinedException, but the issue is fundamentally the same).

HongPong’s picture

+1 also having this problem. Hmm..

HongPong’s picture

Interestingly I got a major chunk of my WP import to actually work.

Applied this patch: https://www.drupal.org/files/issues/2830036-28.patch in #2830036: MigrationPluginManager::getDefinitions() blows up in node derivers. That got past the previous error.

I could see the import was primed to go. Not sure where to start it. Went over to drush.

This should be caught better:

drush mmsg
Missing argument 1 for drush_migrate_tools_migrate_messages(), called in phar:///usr/local/bin/drush/includes/command.inc on line 371 and defined migrate_tools.drush.inc:372

Then this:

$ drush mi --all
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'blog_wordpress_categories'                                                                                                               [status]
Processed 0 items (0 created, 0 updated, 0 failed, 0 ignored) - done with 'blog_wordpress_tags'                                                                                                                    [status]
Processed 110 items (110 created, 0 updated, 0 failed, 0 ignored) - done with 'blog_wordpress_content_post'                                                                                                        [status]

I open the Content admin page and to my surprise all the blog posts are in. But the post categories have become gibberish like
bochahichiuarostuvakochohunonafruclatruhoji , brekoslesachipichadrutorastowrojodrocruuovacrushutakiburamahap etc. Impressive.

Surprised I got this far considering #2573241: Support adding migrations through the UI is a thing.

At /admin/structure/migrate/manage/my_wordpress_blog/migrations I get :

Migration / machine name / status / total / imported / unprocessed:
Import from WordPress XML blog_wordpress_categories Idle 1 22 -21

So somehow a negative number is unprocessed. In my case I can just not import categories and find another way to set them. Pleasant to get this far and avoid that much data entry, but wow. I will reset my imports and take another spin at it. Interesting stuff, probably almost close enough for our purposes.

berliner’s picture

Workaround as described in http://drupal.stackexchange.com/a/227732/8881 is working for me:

$databases['migrate']['default'] = array (
  'database' => 'NAME',
  'username' => 'USER',
  'password' => 'PASS',
  'prefix' => '',
  'host' => 'localhost',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);
splash112’s picture

Is this still current or can be marked as fixed? Seems to work fine (with migrate_tools 4.x dev) on my setup.

HongPong’s picture

Status: Active » Closed (outdated)

Yes I believe the upstream issue about nonexistent databases was resolved thanks splash112. If anyone runs into this again please reopen.