Quantcast
Channel: Recent posts across whole site
Viewing all articles
Browse latest Browse all 49204

Export/import content with Features

$
0
0

Hi all,

I’m planning to contribute a module which will offer nodes import export capabilities for features, let me know what you think about it, if it makes sense to have something like this etc...

Here its description:

Features Content

The module enables Features to export/import nodes objects (along with their files, menu items and CCK fields) in a feature package. For each feature it is possible to decide which node to export (based on its NID, type, etc...) and if to keep its NID or to recreate it from scratch to the next feature import/update. For the moment authorship export is not supported: all the imported nodes will inherit a common user UID (configurable) if their own is not present in the system.

Drush Integration

Drush integration is provided too to allow a quick content export/import simply running:

  • drush content export: export content to a file
  • drush content import: import content from a file
  • drush content clean: utility to clean up content (based on a .info configuration file)

Options include the --file flag to specify the name and location of the dump PHP file.

Use Case 1: Features with default content

The module allow a feature to ship with default content ready to be imported. Possible usages could be:

  • Dummy example content
  • Support pages
  • Credits and others

Use Case 2: Push changes to production

The module could be useful also in case the maintainer needs to push some configuration from development to production. Here the workflow:

  1. run drush content export
  2. push new DB dump
  3. run drush content clean
  4. run drush content import

Implementation

As proof of concept only the Drush integration is working at the moment, although a complete Features integration is on its way. The feature’s .info file module options look like this:

features[features_content][nid][] = 253
features[features_content][nid][] = 254
features[features_content][nid][] = 255
features[features_content][nid][] = 256

features[features_content][type][] = book
features[features_content][type][] = article

The node is the driving force of the module, the export of related items depends on feature wide configuration options, probably looking like:

features[features_content][user settings][export] = 0
features[features_content][user settings][default user] = 1

Viewing all articles
Browse latest Browse all 49204

Trending Articles