backup and restore mongodb data

backup:

mongodump -h dbhost -d xianxia -o dir

restore

mongorestore -d  xianxia dir/xianxia