답변:
drush로 할 수 있습니다 :
$ 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
모든 기사 노드를 serialized 형식으로 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