how to export a full database in MongoDB

This is probably not a very efficient method for huge databases but it is certainly more practical than exporting and re importing a whole collection at a time.
To export a full mongoDB we will first produce a dump:

mongodump -d <database_name> -o <directory_backup>

and then restore it or import it using

mongorestore -d <database_name> <directory_backup>