回答:
あなたはブラシでそれを行うことができます:
$ drush help ne-export
Export nodes using Node export.
Arguments:
nids : A list of space-separated node IDs to export.
Options:
--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.
例えば、
drush ne-export --type=article --file=article.txt
すべての記事ノードをシリアル化された形式でarticle.txtに出力します。その後、drushを使用してそれらをインポートできます。
$ drush help ne-import
Import nodes previously exported with Node export.
Arguments:
Options:
--uid : User ID of user to save nodes as. If not given will use the user with
an ID of 1. You may specify 0 for the Anonymous user.
--file : The filename of the input file. If supplied, the node code will be
imported from that file, otherwise it will import to stdin.
例えば:
drush ne-import --uid=1 --file=article.txt
*更新しました
Drupalの管理ページ(D7では/ admin / content)のすべてのコンテンツのリストに移動し、コンテンツタイプでフィルターし、すべてを選択して、ドロップダウンメニューから[ノードエクスポート]を選択します。
then select 'Node export' from the dropdown menu
どのメニュー?
これは、結果の分割に役立つ場合があります。シンプルなbashスクリプト:
#!/bin/bash
# Run this script in Drupal root app directory!
# Requirements: drush command tool installed with ne-export command (you need Node Export module installed in Drupal)
maxRows=100
startFrom=0
for i in {0..17}
do
startFrom=$(( (i)*100 ))
echo "SELECT nid FROM node where node.type='noticia' limit $startFrom,$maxRows" # just for debugging
drush ne-export --file="nodes-exported/nodes-exported-$i.json" --format='json' --sql="SELECT nid FROM node where node.type='noticia' limit $startFrom,$maxRows" # of course set your own SQL here
done
exit 0