Importing Posts from Blogger to Drupal

Importing posts from blogger to Drupal is a piece of cake if you have the feeds module installed.

All you need is the common RSS XML parser setting and the field mappings to Drupal's own core blog module.

A working importer configuration (which too can be imported) is given here. The node author can be changed here, or in the node processor configuration settings.

PS: You can use blogger's backup setting to first export all your posts as an XML file.

$feeds_importer = new stdClass();
$feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */
$feeds_importer->api_version = 1;
$feeds_importer->id = 'knownexception';
$feeds_importer->config = array(
  'name' => 'knownexception',
  'description' => 'knownexception',
  'fetcher' => array(
    'plugin_key' => 'FeedsFileFetcher',
    'config' => array(
      'allowed_extensions' => 'txt csv tsv xml opml',
      'delete_uploaded_file' => FALSE,
      'direct' => FALSE,
      'directory' => 'public://feeds',
      'allowed_schemes' => array(
        0 => 'public',
      ),
    ),
  ),
  'parser' => array(
    'plugin_key' => 'FeedsSyndicationParser',
    'config' => array(),
  ),
  'processor' => array(
    'plugin_key' => 'FeedsNodeProcessor',
    'config' => array(
      'expire' => '-1',
      'author' => '1',
      'authorize' => 0,
      'mappings' => array(
        0 => array(
          'source' => 'title',
          'target' => 'title',
          'unique' => FALSE,
          'language' => 'und',
        ),
        1 => array(
          'source' => 'description',
          'target' => 'body',
          'unique' => FALSE,
          'language' => 'und',
        ),
        2 => array(
          'source' => 'timestamp',
          'target' => 'created',
          'unique' => FALSE,
        ),
      ),
      'insert_new' => '1',
      'update_existing' => '1',
      'update_non_existent' => 'skip',
      'input_format' => '3',
      'skip_hash_check' => 0,
      'bundle' => 'blog',
      'language' => 'und',
    ),
  ),
  'content_type' => '',
  'update' => 0,
  'import_period' => '-1',
  'expire_period' => 3600,
  'import_on_create' => 1,
  'process_in_background' => 0,
);

Comments