From 9cc5abd094122052901afc6f1db00a230f89713f Mon Sep 17 00:00:00 2001 From: jsboige Date: Fri, 19 Jun 2026 21:24:04 +0200 Subject: [PATCH] =?UTF-8?q?docs(dnn):=20#131=20fix=20Phase=202=20=C2=A74.2?= =?UTF-8?q?=20RESTORE=20order=20=E2=80=94=20VERIFYONLY=20before=20RESTORE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addresses the NanoClaw concern flagged on #548 (merged; corrected here in follow-up per ai-01 dispatch msg-20260619T170757). The §4.2 SQL block ran RESTORE DATABASE … WITH REPLACE THEN RESTORE VERIFYONLY — but verifying a backup AFTER overwriting the DB is useless (too late to act on a failure). The inline comment already said "VERIFYONLY first, always" and §4.3 requires VERIFYONLY green BEFORE Step 2.2. The block contradicted its own contract. Fix: move RESTORE VERIFYONLY to step (a), BEFORE RESTORE DATABASE (b), with explicit conditional logic — (b) only runs if (a) is green, (c) abort if (a) failed. Now consistent with §4.3 and the rollback contract. Doc-only, safety correction. No execution. Co-Authored-By: Claude Opus 4.6 --- docs/dnn-localization/131-dnn-phase2-exec-rollback.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/dnn-localization/131-dnn-phase2-exec-rollback.md b/docs/dnn-localization/131-dnn-phase2-exec-rollback.md index 21a4505c..6381fc1f 100644 --- a/docs/dnn-localization/131-dnn-phase2-exec-rollback.md +++ b/docs/dnn-localization/131-dnn-phase2-exec-rollback.md @@ -135,13 +135,15 @@ upgrade). Use the **Step 1.5.0 backup** only if you want to reset everything (in ``` 1. STOP the IIS site (free all file locks). -2. DB RESTORE: +2. DB RESTORE (VERIFYONLY FIRST — the rollback contract, #527 §6 / §4.3 here): + -- (a) verify the backup is restorable BEFORE overwriting anything: + RESTORE VERIFYONLY FROM DISK = '…\.bak' WITH CHECKSUM; + -- (b) ONLY if (a) is green, kick everyone out and overwrite: ALTER DATABASE [DotNetNuke] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; RESTORE DATABASE [DotNetNuke] FROM DISK = '…\.bak' WITH REPLACE, RECOVERY, CHECKSUM; - -- VERIFYONLY first, always (the rollback contract, #527 §6): - RESTORE VERIFYONLY FROM DISK = '…\.bak' WITH CHECKSUM; + -- (c) abort if (a) failed — do NOT run (b) on an unverifiable backup. 3. WEBROOT RESTORE: - delete the upgraded webroot's bin/ + the wizard-touched files - restore bin/, web.config, Portals/, DesktopModules/, App_Data/ from the anchor's files backup