Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

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

share|improve this answer
    
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 '13 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. –  greg_1_anderson Feb 21 '13 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 '13 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 '13 at 20:19
    
@Levox, yup and submodules never will "auto install" ... they're optional and there if you need them. –  tenken Feb 21 '13 at 23:46
add comment

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.
share|improve this answer
    
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 '13 at 20:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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