Import Drupal nodes with Migrate & Table Wizard
I'm following Angie Byron's Lullabot article on using the Migrate and Table Wizard modules to import data into Drupal. My current project requires importing hundreds of pages from a static HTML site, so it's crucial that I have a reliable way to automate that process. At first I tried to use the Node Import module to import my spreadsheet generated .csv file, but the module wouldn't import date CCK fields! The Node Import module also failed in the past with importing Flags and recently seems to have a problem even importing plain text fields!
- I get my spreadsheet into MySQL using Navicat for MySQL client's import table wizard
- I add and enable the modules (above)
- I notice the Table Wizard has a module which may not have been available when Angie documented her process--the Import Delimited Files module--which might allow me to skip her first step: to get the data into MySQL. ;)
- Yes! Using the Import Delimited Files module works great.
- One thing I didn't notice in Angie's write-up was the fact that you must assign or create a primary key to the table imported and you must specify the types and lengths of each column through the database administration tool (phpMyAdmin or, in my case Navicat MySQL).
After specifying column details:
And adding a new column "id" as the unique primary key for the table...:
- I found a the ability to update previously imported content but found a (unrelated) confusing error message related to one of the first file uploads I tried.
- And found it straightforward to map all source database/spreadsheet fields to destination node fields and settings:
- Nice work, moshe and crew!