title: mongodb dump and pipe to other db name
body: <p>Mongodb version 3.2.12. I have two local databases, "base1" and "base2"</p>
  
  <p>I want to copy all data (all collections) from base1 over to base2, replacing everything there (like when dumping production to a dev environment).</p>
  
  <p>Any pipe command (or other simple way) to do this?</p>
  
  <p>I tried</p>
  
  <pre><code>mongodump --archive --db base1 | mongorestore --db base2 --archive
  </code></pre>
  
  <p>lists a lot of "writing base1.collectionname to archive on stdout", but nothing gets written to base2.</p>
  
  <p>I also tried</p>
  
  <pre><code>mongodump --db base1 --gzip --archive=/path/to/file.gz
  mongorestore --db base2 --gzip --archive=/path/to/file.gz
  </code></pre>
  
  <p>Dump works, restore just says "creating intents for archive", "done"</p>