Hi, thanks for this great module.

Is it correct that it is not (yet) possible to import from a second database? I have an old database running on the same db server as my new Drupal installation and it would be great if I could import directly from the old database. I just tried it: the table wizard part works fine, the creation of a content set seems ok, but when I try a test import, I get the following message:

user warning: SELECT command denied to user 'old_db_user'@'localhost' for table 'drupal_migrate_map_1' query: ...

I haven't checked out the inner workings of migrate.module, but this looks to me as if Migrate is trying to access the new (Drupal) database using the username of the old database.

CommentFileSizeAuthor
#1 migrate_other_db_help.patch1.34 KBmarcvangend
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marcvangend’s picture

Component: Code » Documentation
Category: bug » task
Status: Active » Needs review
FileSize
1.34 KB

OK, I understand it much better now. Looking at the code in migrate.module, it became clear to me that importing from an external database is supposed to work already. So I took a second look at the error message and realized that migrate.module queries both databases in one single query. Obviously that is not going to work when you connect to both db's with different user names and passwords. This was easily fixed with GRANT SELECT ON `old_db`.* TO 'new_db_user'@'localhost'; and changing my settings.php so that both db connections use the same user name and password.

Conclusion: problem solved, but this should be documented. A patch for the configuration.html help file is attached.

mikeryan’s picture

Status: Needs review » Fixed

Committed (with a link to the TW advanced help on external dbs), thanks!

Status: Fixed » Closed (fixed)

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

emdalton’s picture

Status: Closed (fixed) » Active

I have this problem on my system, and because my hosting service has disabled certain features of MySQL, I can neither change the login name of the old database I want to use nor can I grant permissions to the old database to the new database user. Could an option be added to manually insert the username and password to the old database somewhere? Or am I going to have to download my old nodes to a CSV file and upload to import?

eiland’s picture

See http://www.lullabot.com/articles/drupal-data-imports-migrate-and-table-w... and you can assign a second db connection in settings.php

mikeryan’s picture

Status: Active » Closed (fixed)