dokku / dokku-mongo

a mongo plugin for dokku
MIT License
174 stars 32 forks source link

Can't restore database #52

Closed figalex closed 8 years ago

figalex commented 8 years ago

I'm trying this:

dokku mongo:import dbname < dbbackup.tar

and I'm getting this error:

tar: Archive is compressed. Use -z option
tar: Error is not recoverable: exiting now

What could be wrong with the file I want to import?

figalex commented 8 years ago

Nevermind, already figured out how to create an uncompressed tar file.

timaschew commented 7 years ago

@figalex How you did that?

I tried to make a dump from my local mongo via

mongodump --db sas --collection documents --archive=sas.dump.tar

but got this error when tried to import it:

root@dokku:/home/user# dokku mongo:import sas < sas.dump.tar
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

When used with gzip I got the same error like you.

When used mongoexport via

mongoexport --db sas --collection documents --out documents.json

I get this error when trying to import it (after wraping it into a dump directory and build a tarball of it):

dokku mongo:import sas < documents.json.tar --collection documents
2016-10-18T22:17:13.686+0000    building a list of collections to restore from /tmp/tmp.sECS7OTsUJ/dump dir
2016-10-18T22:17:13.687+0000    don't know what to do with file "/tmp/tmp.sECS7OTsUJ/dump/documents.json", skipping...
2016-10-18T22:17:13.687+0000    done
josegonzalez commented 7 years ago

You should use the mongo:export command that we have, which should build a file that is compatible with the mongo:import command.

DerKobe commented 6 years ago

I want to restore an exported dump file created with an dokku 0.11.3 into dokku 0.12.12 and I get the error "Failed: gzip: invalid header" on import.