Download the physical backup file and decompress the file to the data directory where MongoDB is located (the data directory must be empty). The following operation assumes that /path/to/mongo is the location directory for MongoDB to be started using the physical backup:
rm -rf *
tar xzvf hins_xxx.tar.gz
MongoDB version: 3.2 or later.
ApsaraDB for MongoDB uses the WiredTiger storage engine by default and enables the directoryPerDB feature. Therefore, select related options in configuration.
The physical backup of ApsaraDB for MongoDB contains the replica set configuration of the original instance. Therefore, MongoDB must be started in single-node mode (the configuration file cannot contain configurations related to replication). Otherwise, access may fail. To start MongoDB in replica set mode, follow these steps after MongoDB is started in single-node mode:
Remove the configurations of the original replica set.
Modify the configuration file to add configurations related to replication.
Restart the mongod process.
Reinitialize the replica set.
The physical backup of ApsaraDB for MongoDB contains the user name and password of the original instance. If authentication is enabled in the configuration file, use the user name and password of the original instance for access.
The following is the configuration template that uses the physical backup to start ApsaraDB for MongoDB (authentication is enabled for the single node):