0
votes

Following other stackoverflow posts, I'm able to export my local database into my app folder (located at dump/meteor).

Then, I've re-deployed, using mup, to my server. No problems there.

I then log onto my server, enter the mongo shell, and dump the old database (called tapshop) using db.dropDatabase(). show dbs confirmed it's present but empty.

Then, after exiting the mongo shell, I try mongorestore --db tapshop dump/meteor and get the following message:

connected to: 127.0.0.1
don't know what to do with file [dump/meteor]

I know I'm missing something in that mongorestore command, but what?

3

3 Answers

0
votes

here is the syntax I use

mongorestore --host localhost --drop  --dir ${backup_fullpath}

which destroys current mongo and replaces with all db from backup dir

0
votes

Try to add the port option in the command line:

mongorestore --host 127.0.0.1 --port 27017 --drop --db tapshop dump/meteor

Remember, in development, mongo runs on port 3001, but in production runs on port 27017.

0
votes

After endless googling I was able to do it. Not the most efficient route, but hey, it works.

First, I added my local dump folder to my server:

scp -r PATH_TO_DUMP_FOLDER USER@SERVER:PATH_TO_SAVE_FOLDER

Then I just ran the mongorestore command after logging into my server:

mongorestore --host 127.0.0.1 --port 27017 --drop --db DB_NAME PATH_TO_DUMP_FOLDER