Migrate contents from Ning forum to Drupal forum?
Does anybody know an effective way to transfer forum conversations from Ning to Drupal? I have the .json obtained through Ning Network Archiver tool, I searched around but didn't find anything.
I am using Drupal version 7.
You can create a module in drupal 7 that will take the json data and create nodes programmatically.
// Instantiate new node $node = new stdClass(); node_object_prepare($node); $node->uid = 1; $node->name = 'my author'; $node->language = LANGUAGE_NONE; // Set fields $node->title = 'my title'; // Set custom fields $node->field_custom[$node->language]['value'] = 'my custom value'; // save node_save($node);
Take a look at the Migrate module (http://drupal.org/project/migrate/).
I'd say that's better than rolling your own module since you get a lot of stuff for free, for example automatic rollback support and such. You just need to define a mapping and a datasource (json, xml, database, etc).
The migrate module takes care of the actual node creation and keeps track of what has been imported so that you can undo it later, re-import new posts, etc.
A good example of the migrate module can be found at http://xdeb.org/node/1539. It does however deal with regular pages and the datasource is a drupal 6 database.