Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copying localhost MongoDB data to meteor servers

Tags:

mongodb

meteor

So I have been playing around with meteor and mongodb and have a working version set up on my localhost. Unfortunately, when I do meteor deploy xxx.meteor.com it doesn't deploy my database as well.

How do I do this?

like image 837
ediblecode Avatar asked Feb 26 '26 18:02

ediblecode


1 Answers

Meter deploy only deploys a fresh database. To copy over your data you have to use mongorestore with your local mongodb dump, which you can make with mongodump (docs)

So first dump your database somewhere

mongodump --host localhost:3002

Get your mongodb`s credentials by running (in your project dir):

meteor mongo myapp.meteor.com --url

This will give you your database details in the form:

mongodb://username:password@host:port/databasename

Then you can plug these into mongorestore (docs) and restore your local database over

mongorestore -u username -p password -h host:port -d databasename ~/desktop/location_of_your_mongodb_dump
like image 184
Tarang Avatar answered Mar 01 '26 09:03

Tarang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!