Closed justintemps closed 6 years ago
I don't think the export is actually a tar. The readme we have is wrong, but if you run dokku mongo:help export
, you'll see the correct usage.
Here is the restore command I am using currently. Works like a charm: restore.sh
dns=$(aws ec2 describe-instances --filters Name=tag:Name,Values=Test --query 'Reservations[].Instances[].PublicDnsName' --output text)
aws s3 cp s3://{bucket}/{file}.tgz {file}.tgz
tar -xvf {file}.tgz
# i am on a different box so i need to copy to the server
scp -r backup/export ubuntu@$dns:~/
ssh ubuntu@$dns << EOF
dokku mongo:import {app} < export
EOF
Hope that helps
@josegonzalez Thanks so much for the fast response! Here's what dokku mongo:help export
says:
export a dump of the MongoDB service database
arguments:
service service to run command against
examples:
by default, datastore output is exported to stdout
dokku mongo:export lolipop
you can redirect this output to a file
dokku mongo:export lolipop > lolipop.dump
export a dump of the MongoDB service database
arguments:
service service to run command against
examples:
by default, datastore output is exported to stdout
dokku mongo:export lolipop
you can redirect this output to a file
dokku mongo:export lolipop > lolipop.dump
I still can't figure out what kind of file it is or how to import it into another mongo instance via mongorestore.
Looks like its the gzip output of mongodump
.
To restore, it should be this command or similar locally.
Thanks @josegonzalez! Turned out to be pretty simple
mongorestore --gzip --archive=mydatabase.dump
This is essentially the same problem as described in #84 and was supposed to have been resolved in ed7acd3.
However, I continue having the same problem whether I try to do the export remotely or after I've ssh'd into my server.
My goal is to export the data from dokku-mongo on my staging server and import it into a local instance of mongo running on localhost (OSX). To do that, I believe I need to be able to export a valid .bson file, which is what I'm guessing the .tar from dokku mongo:export should give me.
This is using DO Dokku One-Click https://www.digitalocean.com/products/one-click-apps/dokku/