Hey! i want to export all nodes of one content type change some field settings and import them again. I did some configuration:

admin/config/content/node_export

I tried drush but get an error:

# drush -u 1 node-export drush -u 1 ne-export
You do not have permission to perform a Node export on one or more of these nodes. No nodes exported. [error]

How can I export all nodes of a content type?

Comments

danielb’s picture

just do drush -u 1 ne-export
that should work afaik

danielb’s picture

oh for a content type
here is the example from the drush help for this module (I don't know the command to make the help appear though!)

drush node-export-export --type=story,page --file=filename
export nodes of type story and page to the file with the supplied filename.

so I suppose you could do this:

drush -u 1 ne-export --type=my-node-type

muschpusch’s picture

Thanks that works!

muschpusch’s picture

Status: Active » Fixed

changing status to fix!

danielb’s picture

Title: usage of the module » Drush usage

FYI here is the complete list of --options you can use

'--file' => "The filename of the output file. If supplied, the node code will be exported to that file, otherwise it will export to stdout.",
'--format' => "If supplied, node code will be output using a particular export format, if available. (e.g. serialize)",
'--status' => "Filter for 'status'; A boolean value (0 or 1) indicating whether the node is published (visible to non-administrators).",
'--promote' => "Filter for 'promote'; A boolean value (0 or 1) indicating whether the node should be displayed on the front page.",
'--sticky' => "Filter for 'sticky'; A boolean value (0 or 1) indicating whether the node should be displayed at the top of lists in which it appears.",
'--translate' => "Filter for 'translate'; A boolean value (0 or 1) indicating whether the node translation needs to be updated.",
'--language' => "Filter for 'language'; The language code (e.g. de or en-US) of this node.",
'--type' => "Filter for 'type'; The machine-readable name (e.g. story or page) of the type of this node.",
'--sql' => "Filter by SQL (EXPERIMENTAL); An SQL query string that returns nids (e.g. \"SELECT nid FROM nodes WHERE nid < 10\").",
'--code' => "Filter by PHP code (EXPERIMENTAL); PHP code that prints or returns, an array or CSV string of nids (e.g. \"custom_get_my_nids();\"). Don't include PHP tags.",

Those last two options (sql and code) are new and I haven't had any feedback on their inclusion, but could potentially allow you to solve any complex filtering you need. You could even have a custom PHP function that pulls nids from a Views module views display in a similar way that node reference does - quite a bit of work to set that up, but it would be really useful once you got it working.

pimok3000’s picture

Title: Drush usage » Drush usage (where is the exported file saved?)

This works great but where is the exported file saved? I can´t find it anywhere on my debian5 Server having giving it a name with --file=nodeexport.

Can someone clearify please?

pimok3000’s picture

Title: Drush usage (where is the exported file saved?) » Drush usage

where is the exported file saved?

After doing some search for myself i found out that the file that you name after --file= will be saved in the drupal root folder. Going there you can easily import that file back again.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

TribalMan’s picture

this does not seem to translate into an xml file that can be converted to csv. How did you edit your changes?

Atomox’s picture

Because Node Export does not seem to handle large exports or batches, I have written a bash script to pass several nids to drush ne-export. [edit] Is there a limit to how many nids the drush command will accept? I can't seem to find this documented anywhere.

kris77’s picture

Issue summary: View changes

This module export and import the content author too?