Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | migrate_other_db_help.patch | 1.34 KB | marcvangend |
Comments
Comment #1
marcvangendOK, 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.
Comment #2
mikeryanCommitted (with a link to the TW advanced help on external dbs), thanks!
Comment #4
emdalton CreditAttribution: emdalton commentedI 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?
Comment #5
eiland CreditAttribution: eiland commentedSee http://www.lullabot.com/articles/drupal-data-imports-migrate-and-table-w... and you can assign a second db connection in settings.php
Comment #6
mikeryan