2

What: I'm breaking a part a huge D7 site into a D7 multi-site instance.

Why: Marketing demands have changed. They different units still want to use the same theme but have different main menus and slight CSS tweaks here and there. They also want separate authors and very different approval processes. This site is crippled under it's own weight.

So far: I've already copied over Content Types via Bundle Copy and most everything that will remain standard via source controlled features.

How/Question: How can I move a piece of content (node/XXX) to another Drupal 7 instance? A drush solution would be preferred so that I have the ability to script this across Stage and Production servers once we figure it out on Dev.

Errata: I've seen interesting methods to scrape content via feeds, sharing content, and seen great dev to prod workflows. However, I haven't seen something that addresses a one-time move of a node between instances.

  • Would it be an option to NOT split the site in multiple instances, but instead use the Group module to implement similar functionality in your existing site? If so, and if you wonder "how", post some kind of related/followup question (and let me know you did) ... – Pierre.Vriens Apr 29 '16 at 19:07
  • Thanks Pierre. For this project, the changes are beyond content and authoring. In fact, I think the multisite separation phase is only one part of a larger plan. Some units may be becoming more independent. Having them already separated off will make my life easier down the road. – Rick Apr 30 '16 at 12:25
  • OK, that makes sense ... sounds like "How do you eat an elephant?", with answer "1 bite (or byte???) at a time", right? Good luck! – Pierre.Vriens Apr 30 '16 at 13:12
2

For the scenario you describe, i.e. a once-off, one-way move from one site to another, automated with drush, Node Export is a good way to do it. You can use the node_export_import() function in your drush script or update hook:

  $file = 'exported_nodes.txt';
  if (file_exists($file)) {
    $nodes = file_get_contents($file);
    $status = node_export_import($nodes);
    // etc.
  }
|improve this answer|||||
2

What would suit you is the Deploy module: https://www.drupal.org/project/deploy

The README.txt states:

The Deploy module is used to deploy Drupal content to other Drupal sites or arbitrary systems. Two concrete use cases are:

  • using it as a content staging solution
  • using it to push content downstream from a main site to several sub sites.

Here's a demo: https://www.youtube.com/watch?v=7PjwT0HWHxw

|improve this answer|||||
  • Upvote. This module interests me. We have a dev-stage-prod model for development and module evaluation. But I'd love to add an authoring server tot that mix. Thanks. – Rick Apr 30 '16 at 12:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.