1. Preliminary preparation
(1) MongoDB database old_db with data and empty database new_db
(2) Prepare MongoDB Tools
and go to the page: https://www.mongodb.com/try/download/database-tools
Select the required version to download and unzip it to your desired In the desired directory:
2. Back up and export the data in the database old_db
(1) Right-click old_db and select MongoDump
(2) Find MongoDump.exe (extracted from Mongo Tools: mongodump.exe )
(3) Select the path where you want to store the data (assuming it is F:\mongoDB_backup) and store it in gz format. After compression, the file size will be only: 10%.
3. Import the collection test_data from old_db into new_db
(1) Right-click on new_db and select MongoRestore
(2) Select gz format and import test_data.gz from F:\mongoDB_backup
Partial reference : Navicat imports and exports MongoDB collections