Files
claudetools/DOS_DEPLOYMENT_GUIDE.md
Mike Swanson 29e2df60c5 feat: Complete DOS machine deployment verification and AD2-NAS sync infrastructure
This checkpoint establishes verified deployment infrastructure for the Dataforth
DOS Update System with proper file synchronization and documentation.

## Key Changes

### TS-4R Backup and Analysis
- Backed up complete TS-4R machine to D:\ClaudeTools\backups\TS-4R\
- Analyzed MENUX.EXE startup menu system (758-line QuickBasic program)
- Documented complete startup sequence: AUTOEXEC.BAT → STARTNET.BAT → MENUX.EXE
- Found MENUX.BAS source code (Feb 2008 version) from KEPCO ABC software archive

### AD2-NAS Sync Infrastructure Fixes
- Created junction: COMMON → _COMMON (single source of truth for software updates)
- Verified bidirectional sync logic prevents data backflow:
  * Test data: DOS → NAS → AD2 → Database (one-way, deleted from NAS)
  * Program updates: AD2 → NAS → DOS (one-way, files remain on AD2)
- Manually deployed correct BAT file versions to NAS after sync connection issues
- Verified all 9 BAT files deployed correctly (5.1KB-8.8KB each)

### Deployment Scripts Created
- check-junction.ps1: Verify COMMON/\_COMMON junction status
- compare-common-folders.ps1: Compare folder contents
- deploy-correct-bat-files.ps1: Deploy BAT files from local to AD2
- fix-common-junction.ps1: Create COMMON → _COMMON junction
- verify-bat-deployment.ps1: Verify file versions on AD2
- manual-push-to-nas.sh: Manual BAT file deployment to NAS
- read-sync-script.ps1: Read Sync-FromNAS.ps1 from AD2
- search-menux-ad2.ps1: Search for MENUX source files

### Documentation Updates
- Updated all deployment guides with MENUX startup sequence
- Added startup flow to credentials.md and session logs
- Documented junction requirement for COMMON/\_COMMON
- Added data flow verification confirming unidirectional sync

## Technical Details

**Files Deployed to NAS (2026-01-20 09:01-09:02):**
- UPDATE.BAT (5,181 bytes) - Machine backup utility
- DEPLOY.BAT (5,579 bytes) - One-time deployment installer
- NWTOC.BAT (6,305 bytes) - Network to Computer updates
- CTONW.BAT (7,831 bytes) - Computer to Network uploads
- CTONWTXT.BAT (1,504 bytes) - Text file version
- CHECKUPD.BAT (6,495 bytes) - Check for updates
- STAGE.BAT (8,794 bytes) - Stage system files
- REBOOT.BAT (5,099 bytes) - Apply staged updates
- AUTOEXEC.BAT (2,211 bytes) - DOS startup configuration

**Sync Logic Verified:**
- PULL: /data/test/TS-*/LOGS/*.DAT copied to AD2, then deleted from NAS
- PUSH: C:\Shares\test\_COMMON\ProdSW\* copied to /data/test/COMMON/ProdSW/
- No reverse flow in either direction (test data never returns to DOS)

**Junction Created:**
- Target: C:\Shares\test\COMMON → C:\Shares\test\_COMMON
- Eliminates duplicate file maintenance
- Backup saved to C:\Shares\test\COMMON.backup

## Files Modified
- DOS_DEPLOYMENT_GUIDE.md: Added automatic startup sequence
- docs/DEPLOYMENT_GUIDE.md: Updated post-reboot expectations
- docs/ENGINEER_HOWTO_GUIDE.md: Added MENUX menu loading step
- credentials.md: Documented startup sequence and MENUX interface
- session-logs/2026-01-19-session.md: Added startup documentation

## Files Added
- 8 PowerShell deployment/verification scripts
- 3 HTML documentation exports
- TS-4R complete backup (not committed to git)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-20 16:03:00 -07:00

501 lines
11 KiB
Markdown

# DOS Update System - Deployment Guide
**Last Updated:** 2026-01-19
**Target Systems:** ~30 DOS 6.22 test stations (TS-4R, TS-7A, TS-12B, etc.)
**Deployment Script:** DEPLOY.BAT
**Status:** Ready for Production Deployment
---
## Overview
This guide walks through deploying the new DOS Update System to test station machines. The deployment is a **one-time process** per machine that installs batch files and configures the machine for automatic updates.
**What Gets Installed:**
- NWTOC.BAT - Download updates from network
- CTONW.BAT - Upload changes to network
- UPDATE.BAT - Full system backup
- STAGE.BAT - System file staging
- REBOOT.BAT - Apply updates on reboot
- CHECKUPD.BAT - Check for available updates
**Installation Location:** C:\BAT\
---
## Prerequisites
### Before You Start
1. **Network Drive Must Be Mapped**
- T: drive must be mapped to \\D2TESTNAS\test
- Verify by typing `T:` at DOS prompt
- If not mapped, run: `C:\NET\STARTNET.BAT`
2. **Have Machine Name Ready**
- Know this machine's identifier (e.g., TS-4R, TS-7A, TS-12B)
- Machine name must match folder structure on network
- Check with supervisor if unsure
3. **Backup Current AUTOEXEC.BAT** (Optional)
- Script will create C:\AUTOEXEC.SAV automatically
- Manual backup: `COPY C:\AUTOEXEC.BAT C:\AUTOEXEC.OLD`
4. **Ensure Free Disk Space**
- Need ~100 KB free on C: drive
- Check with: `CHKDSK C:`
---
## Deployment Steps
### Step 1: Navigate to Deployment Script
```batch
T:
CD \COMMON\ProdSW
DIR DEPLOY.BAT
```
You should see DEPLOY.BAT listed. If not found, contact system administrator.
### Step 2: Run DEPLOY.BAT
```batch
DEPLOY
```
**Expected Output:**
```
==============================================================
DOS Update System - One-Time Deployment
==============================================================
This script will install the new update system on this machine.
What will be installed:
- NWTOC.BAT (Download updates from network)
- CTONW.BAT (Upload changes to network)
- UPDATE.BAT (Full system backup)
- STAGE.BAT (System file staging)
- REBOOT.BAT (Apply updates on reboot)
- CHECKUPD.BAT (Check for updates)
Press any key to continue...
```
Press any key to continue.
### Step 3: Verification Phase
Script checks:
1. **T: Drive Accessible**
```
[STEP 1/5] Checking network drive...
[OK] T: drive is accessible
T: = \\D2TESTNAS\test
```
2. **Deployment Files Present**
```
[STEP 2/5] Verifying deployment files...
[OK] All deployment files found on network
Location: T:\COMMON\ProdSW\
```
If either check fails, script stops with error message.
### Step 4: Enter Machine Name
```
[STEP 3/5] Configure machine name...
Enter this machine's name (e.g., TS-4R, TS-7A, TS-12B):
Machine name must match the folder on T: drive.
Example: If this is TS-4R, there should be T:\TS-4R\
Machine name: _
```
**Enter your machine name** (e.g., TS-4R) and press Enter.
**Expected Output:**
```
[OK] Machine name: TS-4R
Checking for T:\TS-4R\ folder...
[OK] Machine folder ready: T:\TS-4R\
```
Script creates the folder on network if it doesn't exist.
### Step 5: File Installation
```
[STEP 4/5] Installing update system files...
Backing up AUTOEXEC.BAT...
[OK] Backup created: C:\AUTOEXEC.SAV
Copying update system files to C:\BAT\...
[OK] NWTOC.BAT
[OK] CTONW.BAT
[OK] UPDATE.BAT
[OK] STAGE.BAT
[OK] CHECKUPD.BAT
[OK] All update system files installed
```
### Step 6: AUTOEXEC.BAT Update
```
[STEP 5/5] Updating AUTOEXEC.BAT...
[OK] Added to AUTOEXEC.BAT: SET MACHINE=TS-4R
```
Script adds `SET MACHINE=TS-4R` to your AUTOEXEC.BAT file.
### Step 7: Deployment Complete
```
==============================================================
Deployment Complete!
==============================================================
The DOS Update System has been installed on this machine.
Machine name: TS-4R
Backup location: T:\TS-4R\BACKUP\
Update location: T:\COMMON\ProdSW\
==============================================================
Available Commands:
==============================================================
NWTOC - Download updates from network
CTONW - Upload local changes to network
UPDATE - Backup entire C: drive to network
CHECKUPD - Check for available updates
==============================================================
Next Steps:
==============================================================
1. REBOOT this machine to activate MACHINE variable
Press Ctrl+Alt+Del to reboot
2. After reboot, system will automatically:
- Start network (STARTNET.BAT)
- Download updates (NWTOC.BAT runs automatically)
- Load test menu (MENUX.EXE)
3. Create initial backup when convenient:
C:\BAT\UPDATE
==============================================================
Deployment log saved to: T:\TS-4R\DEPLOY.LOG
Press any key to exit...
```
---
## Post-Deployment Steps
### 1. Reboot Machine
**REQUIRED:** You must reboot for MACHINE variable to take effect.
```
Press Ctrl+Alt+Del
```
Wait for machine to restart and DOS to load.
### 2. Run Initial NWTOC
After reboot, download all available updates:
```batch
C:\BAT\NWTOC
```
**Expected Output:**
```
==============================================================
Download: Network to Computer (NWTOC)
==============================================================
Machine: TS-4R
Source: T:\COMMON\ProdSW and T:\TS-4R\ProdSW
Target: C:\BAT, C:\ATE
==============================================================
[1/2] Downloading shared updates from COMMON...
[OK] Shared updates downloaded
[2/2] Downloading machine-specific updates...
[OK] Machine-specific updates downloaded
==============================================================
Download Complete
==============================================================
```
### 3. Create Initial Backup
Backup your current system state:
```batch
C:\BAT\UPDATE
```
This creates a full backup of C: drive to T:\TS-4R\BACKUP\.
**WARNING:** First backup can take 15-30 minutes depending on data size.
---
## Daily Usage
### Checking for Updates
```batch
CHECKUPD
```
Shows available updates without downloading them.
### Downloading Updates
```batch
NWTOC
```
Downloads and applies updates from network. Run this:
- At start of shift
- After supervisor announces new updates
- When CHECKUPD shows updates available
### Uploading Changes
```batch
CTONW
```
Uploads your local changes to network (machine-specific location).
```batch
CTONW COMMON
```
Uploads to COMMON location (affects all machines - requires confirmation).
### Creating Backup
```batch
UPDATE
```
Creates full backup before making changes.
---
## Troubleshooting
### ERROR: T: drive not available
**Problem:** Network drive not mapped.
**Solution:**
```batch
C:\NET\STARTNET.BAT
```
Or manually map:
```batch
NET USE T: \\D2TESTNAS\test /YES
```
### ERROR: MACHINE variable not set
**Problem:** AUTOEXEC.BAT not updated or machine not rebooted.
**Solution:**
1. Check AUTOEXEC.BAT contains: `SET MACHINE=TS-4R`
2. If missing, add line manually
3. Reboot machine: `Ctrl+Alt+Del`
Or set temporarily:
```batch
SET MACHINE=TS-4R
```
### ERROR: Deployment files not found on network
**Problem:** Files not synced from AD2 to NAS yet.
**Solution:**
- Wait 15 minutes (sync runs every 15 minutes)
- Contact system administrator
### ERROR: Could not backup AUTOEXEC.BAT
**Problem:** C: drive may be write-protected or full.
**Solution:**
- Check disk space: `CHKDSK C:`
- Continue deployment anyway (Choose Y when prompted)
- Backup AUTOEXEC.BAT manually after deployment
### WARNING: MACHINE variable already exists
**Problem:** DEPLOY.BAT was run before.
**Solution:**
- Check current AUTOEXEC.BAT for existing MACHINE variable
- Choose Y to update, N to skip
- If updating, manually edit AUTOEXEC.BAT to change value
---
## File Locations
### Local Machine (DOS)
```
C:\BAT\ - Update system batch files
C:\ATE\ - Application programs and data
C:\AUTOEXEC.BAT - Startup configuration (modified)
C:\AUTOEXEC.SAV - Backup of original AUTOEXEC.BAT
```
### Network (T: Drive)
```
T:\COMMON\ProdSW\ - Shared updates (all machines)
T:\TS-4R\ProdSW\ - Machine-specific updates
T:\TS-4R\BACKUP\ - Machine backups (created by UPDATE.BAT)
T:\TS-4R\DEPLOY.LOG - Deployment log
```
### Backend (Automatic Sync)
```
AD2: C:\Shares\test\COMMON\ProdSW\ - Source for shared updates
AD2: C:\Shares\test\TS-4R\ProdSW\ - Source for machine-specific
NAS: /mnt/raid1/ad2-test/ - D2TESTNAS storage
```
---
## Deployment Checklist
Use this checklist when deploying to each machine:
- [ ] Network drive T: is mapped and accessible
- [ ] Know machine name (TS-4R, TS-7A, etc.)
- [ ] Run DEPLOY.BAT from T:\COMMON\ProdSW\
- [ ] Enter machine name when prompted
- [ ] Wait for all files to copy successfully
- [ ] Verify deployment complete message
- [ ] Reboot machine (Ctrl+Alt+Del)
- [ ] After reboot, run C:\BAT\NWTOC
- [ ] Verify updates downloaded successfully
- [ ] Run C:\BAT\UPDATE to create initial backup
- [ ] Verify backup created on network (T:\TS-4R\BACKUP\)
- [ ] Test CHECKUPD command
- [ ] Document deployment in system log
---
## Deployment Status Tracking
### Machines Deployed
| Machine | Date | Status | Notes |
|---------|------|--------|-------|
| TS-4R | 2026-01-19 | Testing | Pilot deployment |
| TS-7A | | Pending | |
| TS-12B | | Pending | |
| ... | | | |
**Update this table as machines are deployed.**
---
## Rollback Procedure
If deployment causes issues:
### 1. Restore AUTOEXEC.BAT
```batch
COPY C:\AUTOEXEC.SAV C:\AUTOEXEC.BAT /Y
```
### 2. Remove Batch Files
```batch
DEL C:\BAT\NWTOC.BAT
DEL C:\BAT\CTONW.BAT
DEL C:\BAT\UPDATE.BAT
DEL C:\BAT\STAGE.BAT
DEL C:\BAT\CHECKUPD.BAT
```
### 3. Reboot
```
Ctrl+Alt+Del
```
### 4. Report Issue
Contact system administrator with:
- Machine name
- Error messages seen
- When the issue occurred
- T:\TS-4R\DEPLOY.LOG contents
---
## Support Contacts
**System Administrator:** [Your contact info]
**Deployment Issues:** Check T:\TS-4R\DEPLOY.LOG first
**Network Issues:** Verify T: drive with `NET USE`
---
## Appendix: Behind the Scenes
### How Updates Flow
1. **System Administrator** copies files to AD2 (\\192.168.0.6\C$\Shares\test\)
2. **AD2 Sync Script** runs every 15 minutes, pushes to NAS
3. **NAS** makes files available via T: drive to DOS machines
4. **DOS Machines** run NWTOC to download updates
5. **Users** run CTONW to upload machine-specific changes
### Sync Schedule
- **AD2 → NAS:** Every 15 minutes (Sync-FromNAS.ps1)
- **Maximum Propagation Time:** 15 minutes from AD2 to DOS machine
- **Sync Status:** Check T:\_SYNC_STATUS.txt for last sync time
### File Types
**Batch Files (.BAT):** Update system commands
**Executables (.EXE):** Application programs
**Data Files (.DAT):** Configuration and calibration data
**Reports (.TXT):** Test results uploaded from DOS machines
---
**Deployment Version:** 1.0
**Script Location:** T:\COMMON\ProdSW\DEPLOY.BAT
**Documentation:** D:\ClaudeTools\DOS_DEPLOYMENT_GUIDE.md
**Last Updated:** 2026-01-19