Data importing

As Drupal moves more from a website tool to an application framework, its generic data interfaces and handling tools become more important.

 

Backup and Migrate: is one of the first tools to look at, allowing manual and automated backup/ restore. A good way to transfer a site from one provider.

 

As regards data importing, the basic steps are:

  1. Get your data into a MySQL table (Table Wizward can import CSV)
  2. Create tables keys, change column types if needed (via mthe ymsql command line, or the Data module).
  3. Use Table Wizard (tw) module to expose the Table as a View.
  4. Use Migrate to map the a View of external data to native Drupal data, then run the import.

Lets look at the modules found in this domain so far…

 

The Table Wizard can views-enable any table, even those not in the drupal db and not known to drupal.  It performs analysis of the tables it manages, reporting on empty fields, data ranges, ranges of string lengths, etc.. It provides an API for other modules to views-enable their tables. Can work with the Migrate module.

 

The Schema API allows modules to declare their database tables and provides functions for creating, dropping, and changing tables, columns, keys, and indexes. It examines (and can compare) the live database and creates Schema API data structures for all tables that match the live database. Used by tw.

The Data module helps model, manage tables and an API for accessing their contents.

 

The Migrate and Migrate_extras modules (which depend on tw and schema) provide a flexible framework for migrating content into Drupal from other sources.

The print module allows "printer friendly" pages of nodes or views to be shown.

 

The views_export_xls module allows a view to be exported in an XML format that Microsoft Excel understands.

 

Uses cases not yet examined: data export to csv (views_bonus module?). Import/export from/to postgres

& xmlrpc (e.g. openerp). Creating a UI for editing data in non node tables.

 

Further reading: