Drupal Importing Nodes with the Feeds Module
If you've ever been part of a site migration project, then you probably understand the challenges that come with moving a large amount of data. Now, for the sake of comparison I'm going to assume that you've already cleaned up your data and have it ready to import from something like a .txt or .csv file. Personally, I've built numerous affiliate product sites and a couple of e-commerce and so I know that getting the data in a suitable format can be challenging.
Historically I've used Node Import, but while the functionality was decent; one little mistake and you had to start the tedious 8 step process all over again. Get to the final step and fail a few times in a row and you'll start to get pretty frustrated.
Now for some reason it hit me the other day that the Feeds module would import from a .csv file and I thought I'd give it a try. To my surprise, it was actually easier than I anticipated; so here's just a synopsis of my findings.
- Clean your data - I know I made the assumption earlier that you'd already done that, but I can't actually stress how important it is to have you data ready to go, it will save you a lot of /admin/node/edit time.
- Assign a GUID - Drupal and the Feeds module need some way to uniquely identify content and that's what GUID does. Typically you'll want this to be something that doesn't need to be shown to the users, you might even have to add a table for it during import. One important thing to note is that if you fail to set this value with a .CSV file import then feeds will get stuck in an endless import loop (not good).
- Set Refresh to Never - Once you've done the import, the file will still be sitting on your server, and feeds will continue to try and import the file on a regular basis.
- Copy and Paste your Mappings - Since you'll actually have to use the exact same name in the mappings area as you have on your data rows, copy and paste them from one system to the next to avoid any data not being properly transferred.
- Test a Small Sample - One thing Node Import did do, that you can't do using this format, is get a small preview of what/where data was going before you did the import. So, unless you want to spend a lot of time deleting or editing nodes, be sure to do a sample run first of 2 or 3 nodes that can easily be deleted but will provide some valuable import feedback.