Recover Data at an Incident Time

When incident-time data is needed and matching checkpoints, history store and original logs survive, use PDU to build a recovery index and export candidates for a specified target time. The following sections describe initialization, time selection and recovery in detail.


I. Initialization

MONGODBDATA=/recovery-input/mongodb/source/dbpath
param sourceversion 8.0.0;
param sourcekind copy;
param sourcefrozen true;
param hssourceabi le64;
ds recovery idx;
ds recovery status;
ds recovery candidates;

Retain checkpoint relationships, collection generations, time evidence and unresolved reasons. Do not generate guessed values when bases, complete modification chains or transaction-terminal evidence are missing.


II. Set Recovery Time

param recoveryat 1700000000:1;

# Or use an exact recorded wall-clock commit boundary:
param recoveryat none;
param recoverytime 2026-10-04T10:00:00Z;

recoveryat uses source MongoDB logical time. recoverytime requires Z or an explicit time zone and must match exactly one original oplog commit boundary. The parameters are mutually exclusive. Replace example times with original evidence.


III. Restore Data

param restype update;
scan appdb.orders;
restore appdb.orders;

# Export the complete selected snapshot, including unchanged records:
ds recovery unload appdb.orders;

scan and restore select deletion or update candidates by RESTYPE. ds recovery unload exports complete time-snapshot candidates including unchanged records. Recovery generates offline files without writing to a target database.


IV. Handle Unrecoverable Content

Retain explicit errors when the target is outside the evidenced oldest/stable interval, values were reclaimed, modify chains are incomplete or wall-clock boundaries are nonunique. Complete replica-set oplog business replay after a checkpoint is not performed, and candidate counts do not establish complete business state.


Output Files

State, source relationships and offline candidates are stored under launch cwd. Retain generation conflicts and unknown attribution separately without merging _id across generations.

Retain native success, failure, unresolved dependencies, original errors and checkpoints. Completed-run resume reads native records and file metadata without checking exported content for counts, JSON, UTF-8, hashes, redecoding or trial import.

MongoDB 文档