Migrate Mongodb Data From Dotcloud to MongoLab

Similar to how you transfer data away from Dotcloud, you can do the same for your mongodb database.

I have been moving away from Dotcloud as they no longer provide free sandbox app.

1
2
3
4
5
6
7
// ssh into mongo db instance first
dot cloud run db

// dump the data, then transfer via ftp
mongodump -h mongo.MYAPP.dotcloud.com:MYPORT -u root -p MYPASSWORD -d MYDBNAME
tar -czf MYDBNAME.tgz dump
curl -u myftpusername:myftppassword -sST MYDBNAME.tgz ftp://myftpdomain.com

I use FTP, but if you prefer S3, you could do this.

Download the tgz and unzip to get a dump directory.

Create a database in mongolab.

1
2
// On local machine, do a mongorestore to mongolab
mongorestore -h xxx037077.mongolab.com:37077 -d MYDBNAME -u root -p MYPASSWORD2 dump/MYAPP/

Comments