# SQM Update 101 - Visual Reference Card

**Print This Page** for your deployment window

---

## QUICK REFERENCE

### Run Update
```
cd C:\___Fire\SqliteMojo
.\Updates\SQM_Update_101.ps1
```

### Test First (Recommended)
```
.\Updates\SQM_Update_101.ps1 -DryRun
```

### Rollback (If Needed)
```
Copy-Item -Path "Backups\SQM_Update_101_*\*" `
          -Destination "Web" -Recurse -Force
```

---

## DEPLOYMENT FLOW

```
┌──────────────────────────────────────┐
│ 1. Prerequisites Validated           │
│    (2-3 sec)                         │
└─────────────┬────────────────────────┘
              ↓
┌──────────────────────────────────────┐
│ 2. Backup Created                    │
│    (10-20 sec)                       │
│                                      │
│    Files saved to:                   │
│    Backups/SQM_Update_101_*          │
└─────────────┬────────────────────────┘
              ↓
┌──────────────────────────────────────┐
│ 3. Deploy + Ordinate                 │
│    (5-10 sec)                        │
│                                      │
│    Files updated:                    │
│    ✓ MigrationExecutor.aspx          │
│    ✓ MigrationAnalyzer.ashx          │
│    ✓ layout.Master                   │
│                                      │
│    Ordinations created:              │
│    ✓ MigrationExecutor.aspx.101      │
│    ✓ MigrationAnalyzer.ashx.101      │
│    ✓ layout.Master.101               │
└─────────────┬────────────────────────┘
              ↓
┌──────────────────────────────────────┐
│ 4. Verify Hashes                     │
│    (5-10 sec)                        │
│                                      │
│    ✓ All files verified              │
│    ✓ No corruption                   │
└─────────────┬────────────────────────┘
              ↓
┌──────────────────────────────────────┐
│ 5. Update Metadata                   │
│    (1-2 sec)                         │
│                                      │
│    ✓ VERSION.md updated              │
│    ✓ VERSION_HISTORY.md updated      │
└─────────────┬────────────────────────┘
              ↓
        ✓ COMPLETE
     ~30-60 sec total
```

---

## STATUS CHECKS

### After Deployment

```
✓ Check backup created:
  DIR C:\___Fire\SqliteMojo\Backups\SQM_Update_101_*

✓ Check ordinations created:
  DIR C:\___Fire\SqliteMojo\Web\Updates\Ordinations\*.101

✓ Check log file:
  TYPE C:\___Fire\SqliteMojo\Web\Updates\SQM_Update_101_Log.txt

✓ Check version updated:
  TYPE C:\___Fire\SqliteMojo\Web\VERSION.md | FIND "1.0.1"

✓ Test portal:
  Open: https://phosend.com/Portal/Admin/
  Click: DevAdmin → Siphon (Migration)
```

---

## ORDINATION REFERENCE

### What Are Ordinations?

Immutable audit copies of every changed file with version number suffix

```
Production File              Ordination Archive
────────────────           ─────────────────────
layout.Master      →→→      layout.Master.101
                            layout.Master.100
                            layout.Master.99

Each has timestamp showing when deployed
```

### Check Ordination History

```
Get-Item "C:\___Fire\SqliteMojo\Web\Updates\Ordinations\layout.Master.*" | 
  Select-Object Name, LastWriteTime | Sort-Object Name -Descending
```

### Restore Any Prior Version

```
# Get layout.Master as it was in v100
Copy-Item "C:\___Fire\SqliteMojo\Web\Updates\Ordinations\layout.Master.100" `
          "C:\___Fire\SqliteMojo\Web\App_MasterPages\layout.Master" -Force
```

---

## ROLLBACK DECISION TREE

```
Portal working normally?
    ├─ YES → ✓ Keep v1.0.1
    │
    └─ NO → Problems observed?
         │
         ├─ One file broken? → Restore that file from backup
         │
         ├─ Multiple issues? → Run full rollback script
         │
         └─ Unknown cause? → Use backup (safest)

Quick Rollback Command:
Copy-Item -Path "Backups\SQM_Update_101_*\*" -Destination "Web" -Recurse -Force
```

---

## WHAT CHANGED IN v1.0.1

| Component | Change | Impact |
|-----------|--------|--------|
| **MigrationExecutor.aspx** | Redesigned UI | Multi-app support visible |
| **MigrationAnalyzer.ashx** | Added endpoints | Multi-app backend ready |
| **layout.Master** | SSI removed | Parser errors fixed |

---

## FILES INVOLVED

### Production Files Updated
```
C:\___Fire\SqliteMojo\Web\
  ├─ Admin\MigrationExecutor.aspx
  ├─ Admin\MigrationAnalyzer.ashx
  └─ App_MasterPages\layout.Master
```

### Backup Location
```
C:\___Fire\SqliteMojo\Backups\
  └─ SQM_Update_101_YYYYMMDD_HHMMSS\  [Timestamped]
     ├─ Admin\...
     └─ App_MasterPages\...
```

### Ordination Archive
```
C:\___Fire\SqliteMojo\Web\Updates\Ordinations\
  ├─ layout.Master.101
  ├─ layout.Master.100
  ├─ MigrationExecutor.aspx.101
  ├─ MigrationExecutor.aspx.100
  ├─ MigrationAnalyzer.ashx.101
  └─ MigrationAnalyzer.ashx.100
```

### Log Files
```
C:\___Fire\SqliteMojo\Web\Updates\
  ├─ SQM_Update_101_Log.txt           [Detailed log]
  ├─ VERSION_HISTORY.md               [What changed]
  └─ VERSION.md                       [Current version]
```

---

## TROUBLESHOOTING QUICK FIXES

### Script Won't Run
```
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```

### Path Not Found
```
Test-Path "C:\___Work\SqliteMojo\Web"
Test-Path "C:\___Fire\SqliteMojo\Web"
```

### File Lock Issues
```
iisreset /STOP
# Run script
iisreset /START
```

### Verification Failed
```
# Check backup integrity
Test-Path "C:\___Fire\SqliteMojo\Backups\SQM_Update_101_*"

# Review log for errors
Get-Content "Updates\SQM_Update_101_Log.txt" | Where-Object {$_ -like "*ERROR*"}
```

---

## SUPPORT DOCUMENTS

| Need | Document |
|------|----------|
| How to run | SQM_UPDATE_101_QUICK_START.md |
| How ordinations work | ORDINATION_VERSIONING_GUIDE.md |
| Technical details | SQM_UPDATE_101_DEPLOYMENT_ARCHITECTURE.md |
| Everything | SQM_UPDATE_101_COMPLETE_DELIVERY_SUMMARY.md |

---

## EMERGENCY CONTACTS

**If update breaks portal:**

1. Check log: `Updates\SQM_Update_101_Log.txt`
2. Review backup location: `Backups\SQM_Update_101_*`
3. Run rollback (see above)
4. Wait 2-3 seconds for IIS refresh
5. Test portal again

**All changes are reversible. You have a backup.**

---

## COMPLIANCE CHECKLIST

✓ **Audit Trail:** Complete ordination versioning  
✓ **Backup:** Pre-update snapshot created  
✓ **Verification:** File hashes verified  
✓ **Logging:** All actions logged with timestamps  
✓ **Rollback:** Instant rollback possible  
✓ **Documentation:** Changes documented  

---

## QUICK STATUS BOARD

```
Component              Status      Version
─────────────────────────────────────────────
Production Portal      READY       1.0.0-alpha
Pre-Prod Changes       READY       1.0.1
Update Script          READY       101
Backup System          READY       Auto
Ordination Archive     READY       Complete
Documentation          READY       5 files
Build                  ✓ SUCCESS

Deployment Status: READY TO PROCEED
```

---

## REMEMBER

1. **DRY RUN FIRST:** `.\SQM_Update_101.ps1 -DryRun`
2. **BACKUP CREATED:** Automatic before any changes
3. **ORDINATIONS SAVED:** Complete version history
4. **ROLLBACK READY:** Instant revert if needed
5. **YOU'RE IN CONTROL:** Take your time, test thoroughly

---

**Deployment Window Time: 30-60 seconds**

**Rollback Time: 2-3 seconds**

**Audit Trail: Permanent**

**Tally Ho! Ready to deploy.** 🚀

---

*Print & bring to deployment window*
