Thursday, August 9, 2012

Methods for exporting content from a Drupal website

I just wrote thoughts on a universal import/export format for website content, and there's obviously the risk of reinventing the wheel.  With the help of Google, let's take a look at some existing methods to export content from Drupal.

Node Export module: "This module allows users to export nodes and then import it into another Drupal installation, or on the same site."  Okay, that sounds useful and cool.  Further the module is available for both Drupal 6 and Drupal 7, and can be run at the command line using Drush.  It exports in one of these formats:

  • JSON - JavaScript Object Notation code which is known for being security friendly. (Drupal 7 only)
  • Drupal var export - A Drupalized PHP array which is similar to var_export(). (Drupal 7 only)
  • Node code - A customized PHP array which is similar to var_export(). (Drupal 6 only)
  • CSV - RFC4180 compliant CSV code. Ideal for viewing in Windows software, and editing data as spreadsheets.
  • Serialize - Very robust, though not human readable, representation through Serialization using the PHP serialize function.
  • XML - XML 1.0 representation which is good for machine-readability and human-readability.
Data export import: This is a sandbox module that hopes to be a generic dataset import/export utility.  It's project page is written much too high level and generic to make sense of whether this is useful or not.

Content migration, import and export: This is a groups.d.o group focusing on import/export.  

Comparison of Content and User Import and Export Modules: A nice useful chart listing the various import and export modules for Drupal, and the characteristics.

HTML Export: "HTML Export allows you to take your Drupal site and select paths from it based on criteria to export to HTML. It supports OG, results from Views, per content type, all menu router items, and all nodes as default criteria for publishing to html."  Sounds really close to what I wrote about in the previous post on this blog (see link at the top).  The Drupal 6 version is in Beta, and the Drupal 7 version is in DEV.

Creating a static archive of a Drupal site: A list of methods to generating a pile of HTML pages out of a Drupal website.  For example:

wget -q --mirror -p --html-extension --base=./ -k -P ./

This could be useful, but the export format doesn't give you the CCK fields as individual data items, doesn't give you the revisions, doesn't do a lot of other things.  It occurs to me the Boost module does something like this as well.

Drush CTools Export Bonus: Hmm... "Adds more functionality to the CTools drush bulk export commands. drush ctex modulename will export all known ctools exportables of a site to a module. But there are also other configurations you'd like to have in code. This project fills in that gap with extra configuration and drush commands."  Basically, ctools has a method of exporting exportables, and this extends that functionality.  It exports stuff into a "module".  Sigh.  So much for reusability of the data in other venues besides Drupal.

How to make configuration objects exportable with CTools:  Goes over some grotty programming API details of how to ..blahblah..

No comments:

Post a Comment