Reputation: 2606
I need to migrate some data from one MYSQL database to another but the snag is that the tables and rows are going to be different as it's going from a custom DB structure or a drupal 7 CMS.
Is there an easy way to do this or are there any tools for mapping the data to the new structure?
I have full access to both databases.
Any advice is very much appreciated.
Upvotes: 1
Views: 1982
Reputation: 1087
Export the actual data to a .csv
file (or the portion of the data you want to import) and use the Feeds module (https://www.drupal.org/project/feeds). It allows to map .csv
fields into the Drupal entity fields via GUI and also allows delete and re-run imports. It's very useful.
Upvotes: 0
Reputation: 46836
If you were just copying the data, you could use a standard dump, like this:
mysqldump -hhostname -uusername -ppassword olddbname \
| mysql -hhostname -uusername -ppassword newdbname
But if you have to convert the data into something Drupal 7 compatible, you're really going to have to write some custom INSERT…SELECT
s that do the conversion.
You might want to look into Drupal's feeds module, which can import data from CSV and other formats. Feeds is officially in "alpha" at the moment, but it's still in widespread use, and if you come across a bug, it would be good to get it reported (or even fixed, if you feel you have the time to contribute to the project).
There are also various Drupal modules at drupal.org that will help you import taxonomy, users, etc from CSV or other sources. Try something, let us know what problems you have.
Upvotes: 2
Reputation: 1315
Have you looked into exporting the file as a CSV from mysql and importing it to drupal? I am not that familiar with Drupal 7, but I believe that you can map the fields and tables that way.
Upvotes: 1
Reputation: 1347
Maybe using a GUI DB manager would help you??
You can try navicat: navicat.com
Upvotes: 2