- Retrieve a list of the files that exist in the _restore directory.
- Remove any entries from the WiredTiger.backup file for files not present in the _restore directory.
- Start an independent instance of WiredTiger on the _restore directory.
- WiredTiger will reconstruct the WiredTiger.wt file from the WiredTiger.backup file.
- The journal files will be replayed. Replaying journal files can result in new files being created.
- Using the list of files retrieved before starting WiredTiger, drop any newly created collection and index files.
- Iterate over the records in the _mdb_catalog.wt file and do the following:
- Records mapping to files not present in the _restore directory will be removed.
- Check that all of the index files are present for a collection being restored.
- Modify the namespace fields where a database rename was requested.
- Modify the namespace fields of the record representing the oplog to local.oplog.restore.
- If a collection to restore is specified in config.system.restore but is not present in the _mdb_catalog.wt and vice-versa, abort the procedure.
- Take a checkpoint.
- For each collection and its indexes to restore, and the oplog:
- Export the file and table metadata from WiredTiger (see here).
- Export the catalog entry (_mdb_catalog.wt) and fast count (sizeStorer.wt).
- Shutdown the WiredTiger instance.
|