微信聊天资料归档管家|郭亿易
Archive only data the user owns or is explicitly authorized to handle. Keep originals read-only and store archives locally unless the user explicitly chooses an authorized remote destination.
Establish the real source scope
- Identify the source as one or more of:
- an official WeChat backup, migration, or export that is readable;
- user-exportedTXT,JSON,HTML,CSV, or similar message records;
- accessiblexwechat_filesmedia, attachment, image, voice, or video folders;
- a manually selected folder containing authorized chat materials. - State the coverage level before archiving:
- media-only when only attachments orxwechat_filesare readable;
- messages and media when readable message exports and attachments are both present;
- verified snapshot only after integrity verification and a restore test pass. - Never describe a media-only archive as a complete chat-history backup.
- If the only source is an encrypted or inaccessible client database, stop and request an official export, migration backup, or readable authorized folder. Do not crack encryption, copy credentials, inspect session stores, or defeat access controls.
Preflight
- Confirm the account label, source folders, archive destination, and retention goal.
- Prefer an encrypted local destination with enough free space, such as a BitLocker-protected drive. Do not default to a public or shared cloud folder.
- Ensure source and archive paths do not overlap.
- Estimate source bytes and compare them with free space. Allow working headroom for the first ingest.
- Record exclusions explicitly. The bundled script skips symbolic links to prevent path escape.
Read references/archive-layout.md when planning storage layout, retention, verification evidence, or recovery drills.
Create an incremental snapshot
Use the bundled standard-library script; it copies bytes without deleting or modifying the source:
python scripts/archive_wechat_export.py ingest `
--source "D:\WeChatExport" `
--archive "D:\WeChatArchive" `
--account "本人微信" `
--report "D:\WeChatArchive\latest-ingest.json"
The ingest must:
- stream every regular file through SHA-256;
- store one physical object per unique hash;
- preserve every original relative path, size, modification time, MIME guess, and snapshot relationship in SQLite;
- fail instead of silently accepting files that changed during reading;
- emit a snapshot ID and machine-readable report.
Run one source root per snapshot. For multiple exports, use separate account labels or source labels so provenance remains clear.
Verify integrity
Run verification after every material ingest and on a recurring schedule:
python scripts/archive_wechat_export.py verify `
--archive "D:\WeChatArchive" `
--report "D:\WeChatArchive\verify-latest.json"
Treat the archive as healthy only when the command exits successfully and reports no missing objects, hash mismatches, size mismatches, broken references, or snapshot-count mismatches. Orphan objects are warnings, not proof of data loss.
Review storage and deduplication
python scripts/archive_wechat_export.py stats --archive "D:\WeChatArchive"
Report logical file bytes, unique stored bytes, deduplicated bytes saved, snapshot count, unique object count, and file categories. Avoid exposing message contents or personal filenames in routine summaries.
Test recovery
Restore into a new empty destination. Never overwrite an existing recovery folder by default.
python scripts/archive_wechat_export.py restore `
--archive "D:\WeChatArchive" `
--snapshot "SNAPSHOT_ID" `
--dest "D:\WeChatRestoreTest" `
--report "D:\WeChatArchive\restore-test.json"
The restore command verifies each restored file hash. Use --overwrite only when the user explicitly authorizes replacing conflicting destination files.
Completion gate
Do not call the job complete until all applicable items pass:
- source scope and coverage level are stated;
- snapshot report exists and has zero ingest errors;
verifyexits successfully;- at least one representative restore test succeeds;
- restored chat text, image, document, and video samples open when those categories exist;
- archive destination protection and retention policy are recorded;
- no credentials, session data, or unauthorized conversations were collected.
If any gate fails, report the archive as partial and name the missing evidence precisely.