mongodb - How-to import meteor.js db to remote mongo -
i have app developed using meteor.js; since locally ok, move dedicated server; i've installed mongodb 2.6 on server following official doc; i've made dump of local app's db using:
mongodump -h 127.0.0.1 --port 3001 -d meteor
and uploaded dump folder /var/www/mywebsite on server;
mongodb configured use auth: true;
trying
mongorestore -h 127.0.0.1 --port 27017 -d mydbname dump/meteor
nothing inserted (using mongo shell root, databases can see local , admin)
my root mongodb user created on admin db: (i've tried also):
mongorestore -h 127.0.0.1 --port 27017 --username root --password xxxxxx -d mydbname dump/meteor { "_id" : "admin.root", "user" : "root", "db" : "admin", "roles" : [ { "role" : "useradminanydatabase", "db" : "admin" } ] }
i have mongo user new database , restore it; after trying different things realized i'm not understanding how do... can this?
from this answer how mongoimport data deployed meteor app? :
dump data existing mongodb (mongodb url: mongodb://user:password@dbhost/dbname)
mongodump -h dbhost -d dbname -u user -p password
this create "dump" directory, data going dump/dbname.
get mongodb url deployed meteor app (i.e. www.mymeteorapp.com)
meteor mongo --url meteor_app_url
note: password expires every min.
upload db dump data meteor app (using example meteor db url)
mongorestore -u my_remote_database_username -p my_remote_database_user_password -h production-db-b2.meteor.io:27017 -db www_mymeteorapp_com dump/dbname/
all data should transferred!
Comments
Post a Comment