Migrating To Drupal From Other Platforms
If you spend enough time working with Drupal you'll eventually end up needing to migrate data or posts from other platforms into a Drupal site. I have had three separate situations where I needed to accomplish this.
- Importing raw data into a site from comma separated value (CSV) files in order to display the data in tables that could be viewed on the site.
- Importing a WordPress blog.
- Importing several blogs from Squarespace.
I have previously covered the first situation in a post titled Moving Beyond Nodes. Please see that post if you're interesting in finding out more about how I accomplished those data imports. The second situation I addressed by utilizing the WP2Drupal module. The third situation I handled by utilizing the Import Typepad module.
WP2Drupal
As fate would have it the WP2Drupal module is currently listed as abandoned. That doesn't mean it can't/won't work for you if you are still on Drupal 6 and WordPress 2.3. For the record the maintainer of WP2Drupal recommends the WordPress Import module which will have a Drupal 7 release. WP2Drupal works by connecting to the database of the WordPress site so you will need to have access to the database settings (host, username and password) of the site you are migrating from. The module will import blog posts, categories, pages, comments and trackbacks from your WordPress site.
Some things to consider prior to importing.
- Mapping of WP users to Drupal users
- Taxonomy vocabulary that will hold the WP categories and tags
- Node types for blog entries and pages
- Input format for posts and comments
- Whether or not the old URLs must be redirected to new ones
Think about all these things before you start the migration. Users, content types and taxonomies are especially important considerations. If things aren't setup correctly and you go ahead with the import many headaches can result. For that reason it's a best practice to make a database backup prior to actually migrating. You can always restore the original database and redo the import if things go wrong.
Import Typepad
Although this module is meant for Typepad/Movable Type blogs I used it to import "journals" (which are basically individual blogs) from Squarespace. To get started you need an export file for each journal that is generated on your Squarespace account. To generate the export file you need to put the journal into structure editing mode, then select Configure This Page, and scroll down to the Data Export section. There is a button there that says "Export Blog Data". Pushing that button generates the file that you will download and then upload using the Import Typepad module. The data that will be imported will be the posts (title and description), and the categories. The date and time of the posting will be preserved as well.
With your various export files in hand you then need to navigate to /admin/content/import_typepad on your Drupal site. There are three things that you need to have set up prior to importing.
- Content types
- Taxonomy vocabulary
- Users
Unlike the WP module there is no automatic user mapping. You will simply select an existing user to assign import posts to. The actual import itself is a 2 step process. In step 1 you select the export file to upload, select the content type to import to, and also select the taxonomy to import categories to. In the next step you see a preview of what the imported content will look like on your site, along with the categories that will be imported. You also map the content to a Drupal user at that time. When you're ready you click an Import button and then wait for a message indicating that the import is complete.
Post Import Tasks
In both cases you'll want to spend time reviewing the content that you imported to make sure things look like you want them to. You may want to adjust input formats or issues related to how the content is displayed on your site. You will also want to use the Views module to create blocks and pages to display groups of posts that you have imported. I have found Views Bulk Operations to be a very helpful tool to correct and update large groups of nodes.
If you have migration tips, and war stories or direct experience with the modules mentioned here, and you would like to share your experiences feel free to do so in the comment section below.
Copyright 2010, Robert Safuto, Some Rights Reserved. Please visit Learn By The Drop to comment, subscribe or explore additional content not available via the RSS Feed.