From 21aa1261818bc0a44c022b8d24c4c8ff97952fa9 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Wed, 6 Aug 2014 14:09:19 -0400 Subject: [PATCH] Add more comments to the Drupal import script since there seems to be a lot of variation in the db schema --- script/import_scripts/drupal.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script/import_scripts/drupal.rb b/script/import_scripts/drupal.rb index 448dd1e768c..4f011b327fd 100644 --- a/script/import_scripts/drupal.rb +++ b/script/import_scripts/drupal.rb @@ -22,11 +22,18 @@ class ImportScripts::Drupal < ImportScripts::Base {id: row['id'], username: row['name'], email: row['email'], created_at: Time.zone.at(row['created'])} end - # Drupal allows duplicate category names, so you may need to exclude some categories or rename them here. + # You'll need to edit the following query for your Drupal install: + # + # * Drupal allows duplicate category names, so you may need to exclude some categories or rename them here. + # * Table name may be term_data. + # * May need to select a vid other than 1. create_categories(@client.query("SELECT tid, name, description FROM taxonomy_term_data WHERE vid = 1;")) do |c| {id: c['tid'], name: c['name'].try(:strip), description: c['description']} end + # "Nodes" in Drupal are divided into types. Here we import two types, + # and will later import all the comments/replies for each node. + # You will need to figure out what the type names are on your install and edit the queries to match. create_blog_topics create_forum_topics