I installed the Migrate Module, Migrate Extras, Migrate UI and Migrate examples module (all Version 6.x-2.0-rc1) They installed without any issues.

At the command line, I went to the modules/migrate/migrate_example and ran drush mi BeerTerm.

I got the error "Unrecognized migration: BeerTerm".

I traced the error to function drush_migrate_validate_common in migrate.drush.inc, where it's trying to find BeerTerm in the Migrate_Status table. There's nothing in the Migrate_Status table in my db.

I then thought I would disable Migrate Example, uninstall it, and reinstall it to see if the correct records were created in migrate_status. But when I unchecked the Migrate Example module on the modules pages and hit submit, I got the following error, and the Migrate Example module remained enabled:

Fatal error: Uncaught exception 'MigrateException' with message 'No migration found with machine name BeerTerm' in /home/elizabet/public_html/cyte/modules/migrate/includes/base.inc:393 Stack trace: #0 /home/elizabet/public_html/cyte/modules/migrate/includes/migration.inc(142): MigrationBase::getInstance('BeerTerm') #1 /home/elizabet/public_html/cyte/modules/migrate/migrate_test/beer.install.inc(47): Migration::deregisterMigration('BeerTerm') #2 /home/elizabet/public_html/cyte/modules/migrate/migrate_test/migrate_example.install(40): migrate_example_beer_disable() #3 /home/elizabet/public_html/cyte/includes/module.inc(462): migrate_example_disable() #4 /home/elizabet/public_html/cyte/includes/module.inc(345): module_invoke() #5 /home/elizabet/public_html/cyte/modules/system/system.admin.inc(923): module_disable() #6 /home/elizabet/public_html/cyte/includes/form.inc(780): system_modules_submit('migrate_example...', Array) #7 /home/elizabet/public_html/cyte/includes/form.inc(420): form_execute_handlers('migrate_example', 'di in /home/elizabet/public_html/cyte/modules/migrate/includes/base.inc on line 393

Any ideas?

Comments

drealeed’s picture

Update:

since I couldn't uninstall via the Drupal UI I manually removed the migrate tables from the mysql db, removed the beer/wine nodes and terms via the website interface, and removed migrate module references from the system and filter_formats tables. Once everything was clean, I reinstalled migrate, flushed the cache, then reinstalled migrate extras, flushed the cache again, then reinstalled migrate example. All installs appeart to work fine. All of the migrate example tables were created. But migrate_status wasn't updated with any entry for BeerTerm, etc.

mikeryan’s picture

Component: Drush » Code
Assigned: Unassigned » mikeryan
Priority: Normal » Critical

Yes, I can reproduce this, (re)installing migrate_example from scratch fails to set up the migrations on D6. D7 is fine, so I imagine it has something to do with autoload. I will investigate...

mikeryan’s picture

Found this note on the autoload project page:

NOTE: Remember to clear all caches in your module's hook_enable() if your module relies on autoload. Autoload information is cached and your class may not be found if the autoload cache is not cleared.

But, no matter how many times I clear the cache in hook_enable(), it still seems to require a drush cc all before the example migrations are recognized. Still working on this...

drealeed’s picture

Thanks so much for that drush cc all command--that did the trick! The import works fine now, no more issues.

mikeryan’s picture

Status: Active » Fixed

Done - needed to call drupal_flush_all_caches() rather than cache_clear_all() in hook_enable(). Also needed to fix up our hook_flush_caches() implementation for the simpletests to work right.

ijf8090’s picture

I'm still seeing this problem
Unrecognized migration: BeerTerm

Have tried drush cc all with no success.

Am working with a Fresh install
aquia-drupal-1.2.33
migrate 6.x-2.0-rc2
autoload 6.x-2.0
dbtng 6.x-1.0-alpha7
drush 4.2

mikeryan’s picture

Status: Fixed » Postponed (maintainer needs more info)

And you enabled migrate_example?

ijf8090’s picture

Just figured that out

I was running drush but to make it work I had to install and enable the following modules
- Migrate extras, Migrate UI, Migrate Example

Onwards and upwards....

Thanks for your prompt follow-up

Ian

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Fixed
martinc’s picture

Version: 6.x-2.0-rc1 » 6.x-2.0-rc2
Status: Fixed » Active

Im getting simular error. Uninstall/reinstall with clear cache will not work either RC1 or RC2.

I also tryed on a clean install. on enableing I get this stack trace
( ! ) DatabaseConnectionNotDefinedException: The specified database connection is not defined: default in /home/quickstart/websites/example.dev/sites/all/modules/dbtng/database/database.inc on line 1516
Call Stack
# Time Memory Function Location
1 0.0000 58772 {main}( ) ../index.php:0
2 0.0433 850552 menu_execute_active_handler( ) ../index.php:18
3 0.0449 890688 call_user_func_array ( ) ../menu.inc:348
4 0.0449 891096 drupal_get_form( ) ../menu.inc:0
5 0.0497 1327956 drupal_process_form( ) ../form.inc:119
6 0.1139 1517820 form_execute_handlers( ) ../form.inc:416
7 0.1139 1520984 system_modules_submit( ) ../form.inc:776
8 0.5873 1669196 drupal_install_modules( ) ../system.admin.inc:932
9 0.8817 1842932 module_enable( ) ../install.inc:331
10 0.9021 2162840 module_invoke( ) ../module.inc:318
11 0.9021 2163528 call_user_func_array ( ) ../module.inc:462
12 0.9021 2163848 migrate_enable( ) ../module.inc:0
13 0.9021 2163848 drupal_flush_all_caches( ) ../migrate.install:158
14 2.4513 3111960 module_invoke_all( ) ../common.inc:3710
15 2.9734 3156088 call_user_func_array ( ) ../module.inc:483
16 2.9734 3156416 migrate_flush_caches( ) ../module.inc:0
17 2.9736 3157668 db_select( ) ../migrate.module:101
18 2.9829 3500332 Database::getConnection( ) ../dbtng.module:179
19 2.9829 3500536 Database::openConnection( ) ../database.inc:1317

Please tell me what other info you need to investigate this error.

mikeryan’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

@martinc: Are you enabling all the modules at the same time on the Modules page? Try doing them one at a time. Also, please upgrade to the latest -dev version of Migrate.

I'm suspecting that calling dbtng in hook_flush_caches() may be problematic, it may not be fully initialized at that time, perhaps Migrate should be doing an old-fashioned db_query() there...

Thanks.

mikeryan’s picture

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Fixed

I've committed changes to make sure dbtng is not invoked at install time, this fix will be in rc3.

webankit’s picture

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'spicmacay.migrate_status' doesn't exist: DELETE FROM {migrate_status} WHERE (machine_name = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => WinePrep ) in MigrationBase::deregisterMigration() (line 343 of /Applications/MAMP/htdocs/sm/sites/all/modules/migrate/includes/base.inc).
ON disabling migrate example

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.