I have a database that hasn't been compacted in a while so its disk size is much larger than actual data and index sizes. I'll be moving it to another database and would like to know:
would compacting speed up mongodump
does mongorestore rebuild the database in a compact way negating the need to compact
Compact + dump should be longer than a single dump since compact in the first run will operate on the same non-compact data.
Yes, it rebuilds the database in a compact way and also releases physical disk space. Simple compact will decrease data size only, but disk space still will be allocated by Mongo (you will not be able to use it for other purposes).