1

I need to export all polls of a D6 site in XML format so that they can be imported to Django. Node export module states that one can choose to export nodes in xml using drush. However I could not find any docs to describe how to do so. I tried:

drush node-export-export --type=poll --file=xpoll

It exports the polls but in array format. I also could not figure out how to do so using the module's GUI.

So appreciate your help to get the nodes XML, preferably using a drush command.

2 Answers 2

6

drush help node-export

You can pass --format to supply the format of the output. Try doing drush node-export-export --type=poll --file=xpoll --format=xml

6
  • Well, unfrotunately I get '$ drush help node-export PHP Fatal error: Cannot redeclare watchdog_drush_help() (previously declared in /usr/share/drush/commands/core/watchdog.drush.inc:6) in /var/www/drupal/sites/all/modules/drush/commands/core/watchdog.drush.inc on line 15 Drush command terminated abnormally due to an unrecoverable error. [error]' and drush with '--format=xml' flag gives the very same array file. Any ideas?
    – Levox
    Feb 20, 2013 at 23:52
  • 1
    Don't put drush inside sites/all/modules. Drush is not a module; it should go in your $PATH, but not in your site. Feb 21, 2013 at 0:09
  • @greg_1_anderson. Thanks for the tip. It soved the 'drush help' issue. But I still get a bunch of 'Creating default object from empty value comment.module:60' when I execute ':/var/www/drupal$ drush node-export-export --type=poll --file=poll.xml --format=xml' and the result is the same: an array
    – Levox
    Feb 21, 2013 at 0:19
  • This drush command worked perfectly to export the xml, but just I realised that I need to enable the node export xml module separately. It had not activated initially when I installed 'node export' module using drush).
    – Levox
    Feb 21, 2013 at 20:19
  • @Levox, yup and submodules never will "auto install" ... they're optional and there if you need them.
    – tenken
    Feb 21, 2013 at 23:46
3

Here's how to export your nodes in XML format using the GUI:

  • Enable the "Node export XML" module.
  • Then, in admin/settings/node_export, in "Format to use when exporting a node :", check "XML".

Then, to export nodes, you have 2 options :

  • if you want to export a single node, you have a "Node export (XML)" tab at the top of each content.
  • if you want to export many nodes, you need the VBO module to perform bulk operations. To enable "node export actions" in the "admin_content" VBO view (/admin/build/views/edit/admin_content), click at the right of "Style : bulk operations" and check "node export (XML)" in the "Selected operations" fieldset. You're now able to bulk export your polls using the "Node export (XML)" option in the "Bulk operations" select area.
1
  • Actually my problem wat that I had not enabled "Node export XML" module! And your answer reminded me to figure this out. After enabling that the drush command above worked and I'd like to take the more straightforward approach of using on line drush command. Thank you so much for your time mate.
    – Levox
    Feb 21, 2013 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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