4

I created a mongo dump with commands (as suggested in this answer)

docker exec -it mongodb bash
mongodump --host $cluster --ssl --username $username --authenticationDatabase admin --db $dbname --gzip --archive > dumpname.gz

Now when I'm trying to restore the dump with

docker exec mongodb bash -c 'mongorestore --gzip --archive=dumpname.gz'

I get

Failed: gzip: invalid header

Yurii
  • 827
  • 2
  • 13
  • 23

1 Answers1

1

It seems like there is some bug with using redirection (>). So when I changed the first command to not use it, mongorestore started to work:

mongodump --host $cluster --ssl --username $username --authenticationDatabase admin --db $dbname --gzip --archive=dumpname.gz

Some similar problems could be found here

Yurii
  • 827
  • 2
  • 13
  • 23