Q:

Import and add index to mongodb on a Dokku install

I have a recently deployed app on an Ubuntu server using Dokku.  This is a Node.js app with a Mongodb database.
For the site to work properly I need to to load geojson file in the database.  On my development machine this was done from the ubuntu command line using the mongoimport command.  I can't figure out how to do this in Dokku.  
I also need to add a geospatial index.  This was done from the mongo console on my development machine.  I also cant figure out how to do that on the Dokku install.

A:

Thanks a lot @Jonathan.  You helped me solve this problem.  Here is what I did.
I used mongodump on my local machine to create a backup file of the database.  It defaulted to a .bson file.
I uploaded that file to my remote server.  On the remote server I put the bson file inside a folder called "dump".  Then tarred that folder.  I initially used the -z flag out of habit but mongo/dokku didn't like the gzip. So I used tar with no compression like so:
tar -cvf dump.tar dump

next I ran the dokku mongo import command:
$dokku mongo:import mongo_claims < dump.tar
2016-03-05T18:04:17.255+0000    building a list of collections to restore from /tmp/tmp.6S378QKhJR/dump dir
2016-03-05T18:04:17.270+0000    restoring mongo_claims.docs4 from /tmp/tmp.6S378QKhJR/dump/docs4.bson
2016-03-05T18:04:20.729+0000    [############............]  mongo_claims.docs4  22.3 MB/44.2 MB  (50.3%)
2016-03-05T18:04:22.821+0000    [########################]  mongo_claims.docs4  44.2 MB/44.2 MB  (100.0%)
2016-03-05T18:04:22.822+0000    no indexes to restore
2016-03-05T18:04:22.897+0000    finished restoring mongo_claims.docs4 (41512 documents)
2016-03-05T18:04:22.897+0000    done

That did the trick.  My site immediately had all the data.  

A:

mongodump will export all the data + indexes from an existing database.
https://docs.mongodb.org/manual/reference/program/mongodump/
Then mongorestore will restore a mongodump with indexes to an existing database.
https://docs.mongodb.org/manual/reference/program/mongorestore/

mongorestore recreates indexes recorded by mongodump.

You can do both commands from you dev machine to the Dokku database.

