Backup & Restore Strategy
A complete backup strategy for DVDAddin — license, settings, workbooks, customised data.
What to backup
The 4 layers you need to back up
| Layer | Frequency | Method |
|---|---|---|
| Workbook (the project Excel file) | Every save (Ctrl+S) | OneDrive sync + weekly archive |
| Add-in license + settings | After every fresh install / activation | Copy 3 files + export the registry |
| Templates and customised data | Whenever you edit them | Copy before every add-in update |
| Custom scripts (VBA, PowerShell) | Whenever you edit them | Git repo / cloud folder |
Layer 1 — Workbook backup
Basic level: AutoRecover
Excel has built-in AutoRecover:
- File → Options → Save → "Save AutoRecover information every" → set 5 minutes.
- Backup files are saved automatically to
%APPDATA%\Microsoft\Excel\.
→ Excel crashes → reopen Excel → a Recover option is offered.
⚠️ Limitation: it only recovers the most recent crash, not a version from a day ago.
Many add-in commands cannot be undone
Commands that write straight onto the worksheet — Create Title, Import Email, Extract Table, Numbering, Merge cells… — cannot be undone with Ctrl+Z. AutoRecover does not help here, because the file never crashed. Safe habit: press Ctrl+S right before running a bulk-write command, so you can still close without saving and go back.
Intermediate level: OneDrive / Google Drive sync
Keep the project in a OneDrive folder:
C:\Users\<user>\OneDrive\Projects\MHC_Van_Phong\Every Ctrl+S → uploaded to the cloud automatically within a few seconds.
OneDrive has Version History (right-click the file → Version history) — restore an older version.
Advanced level: Weekly archive
A PowerShell script that runs every weekend:
$src = 'D:\Projects\MHC_Van_Phong'
$dst = "D:\Backup\MHC\$(Get-Date -Format 'yyyy-MM-dd').zip"
Compress-Archive -Path "$src\*" -DestinationPath $dst -ForceSchedule: Task Scheduler → Weekly Sunday 11PM.
→ One zip file per week → keep the most recent 8 weeks.
Highest level: Off-site backup
For critical projects:
- Local backup + cloud + a physical hard drive kept at another office.
- 3-2-1 rule: 3 copies, 2 different media types, 1 off-site.
Layer 2 — DVDAddin license + settings
The add-in's entire state lives in three places, none of them inside the Excel file:
| Location | Contents |
|---|---|
%LocalAppData%\DVDAddin\ | license.dat, fx_cache.json, admin-config.json |
%APPDATA%\DVDAddin\ | lang.txt (UI language), TCVN-Custom.json, the Backups\ folder |
HKCU\Software\DVD\DVDAddin | All Preferences, API keys, shortcuts, Gantt settings… |
The registry keys and what they mean
HKCU\Software\DVD\DVDAddin\
├── API Keys ← GeminiAPI, ChatGPTAPI, GroqAPI, NvidiaAPI (plain text)
├── Preferences ← every setting in the Preferences window
├── Shortcuts ← custom keyboard shortcuts
├── GanttSettings ← schedule chart configuration
├── Model / Service / Temperature ← AI provider and parameters
├── SyncConfig ← Connect settings
├── Licensing ← MaxSeenUtc, fallback LicenseBlob
├── Translate / TextTools / FileList / Chat / Onboarding / SettingsSee also Customization → Registry tree.
Backup script
$dst = "$env:USERPROFILE\Documents\Backup\DVDAddin"
New-Item -ItemType Directory -Path $dst -Force | Out-Null
# 1. License + cache
Copy-Item "$env:LOCALAPPDATA\DVDAddin\*" $dst -Recurse -Force -ErrorAction SilentlyContinue
# 2. UI language + custom TCVN standards
Copy-Item "$env:APPDATA\DVDAddin\*" $dst -Recurse -Force -ErrorAction SilentlyContinue
# 3. Registry (Preferences, API keys, shortcuts)
reg export "HKCU\Software\DVD\DVDAddin" "$dst\settings.reg" /yThe settings.reg file contains API keys in plain text
The Gemini/OpenAI/Groq/NVIDIA API keys sit in the registry unencrypted, so the export does too. Do not push this file to a shared company drive or a Git repo. Keep it somewhere only you can read, or open the .reg file and delete the API Keys branch before sharing it.
Restore script
$src = "$env:USERPROFILE\Documents\Backup\DVDAddin"
# Close Excel first — the .xll being loaded locks everything
Get-Process EXCEL -ErrorAction SilentlyContinue | Stop-Process -Force
New-Item -ItemType Directory -Path "$env:LOCALAPPDATA\DVDAddin" -Force | Out-Null
New-Item -ItemType Directory -Path "$env:APPDATA\DVDAddin" -Force | Out-Null
Copy-Item "$src\license.dat" "$env:LOCALAPPDATA\DVDAddin\" -Force -ErrorAction SilentlyContinue
Copy-Item "$src\lang.txt" "$env:APPDATA\DVDAddin\" -Force -ErrorAction SilentlyContinue
Copy-Item "$src\TCVN-Custom.json" "$env:APPDATA\DVDAddin\" -Force -ErrorAction SilentlyContinue
reg import "$src\settings.reg"A license cannot be moved to another machine by copying files
The Machine ID is computed as SHA-256(MachineGuid | Machine name | OS version). Copying license.dat to a new machine — or merely renaming the machine, or upgrading Windows to a higher major version — produces a different Machine ID, and the token is treated as belonging to a different machine.
The right way: sign in again with your email/password. See Move license to another machine.
If license.dat cannot be written
When the %LocalAppData%\DVDAddin folder is blocked for writing (ACL, Controlled Folder Access, or an old folder sitting exactly where the file should be), the add-in automatically switches to storing it in HKCU\Software\DVD\DVDAddin\Licensing\LicenseBlob. The registry export above already covers this case — nothing more to do.
Layer 3 — Templates and customised data
What the installer overwrites on every update
The installation folder C:\DVDAddin\ is overwritten by the installer. Two subfolders hold data you may have edited:
C:\DVDAddin\
├── Template\
│ ├── FormNTCV.xlsx ← Work Record Tpl
│ ├── FormNTVL.xlsx ← Material Record Tpl
│ ├── FormNKCT.xlsx ← Diary Template
│ ├── SendEmail.xlsx ← Email Template
│ ├── GanttChart.xlsx ← Gantt Tpl
│ └── RebarCutOptimizer.xlsx ← Cutting Tpl
└── Library\
├── Dinh Muc 1776.xlsx
├── Dinh Muc TT10.2019.xlsx
├── Ke hoach thi nghiem.xlsx
├── TCVN-Standards.json ← the base standards catalogue
└── TCVN-Custom.template.jsonAnything you edit directly inside these two folders is lost on update. Two safe approaches:
- Your own company templates: do not edit the original files — open the template, Save As into the project folder or a shared drive, and use that copy. The template commands only exist to "get the skeleton"; they never force you back to the original file.
- TCVN standards you add yourself: the add-in reads in layers —
Library\TCVN-Standards.jsonis the base,%APPDATA%\DVDAddin\TCVN-Custom.jsonis your overlay. Add your own standards to the overlay, because it sits outside the installation folder and the installer never touches it. The standards catalogue manager (opened from Test Plan) has a Backup button that writes a timestamped copy to%APPDATA%\DVDAddin\Backups\TCVN-Custom_yyyy-MM-dd_HHmm.json; the add-in also creates one automatically right before you Restore over the file, so if you restore the wrong file you can still go back.
Uninstalling wipes C:\DVDAddin
The uninstaller removes the whole installation folder, including files you put there yourself. If you have adapted the forms in C:\DVDAddin\Template\ to your own company, copy them somewhere else before uninstalling. The registry and the license are not removed with it.
Master data shared across the team
Price lists, work-item catalogues and your company's own norms are ordinary Excel workbooks — the add-in has no registration mechanism for them. Manage them as documents:
\\Cloud\DA_MasterData\
├── BangGia_2026_v3.xlsx
├── BangGia_2026.xlsx ← the "current" copy, always pointing at the newest version
└── DanhMucCongTac.xlsxChild workbooks reference the file name without the version suffix so they pick up the new copy automatically. When you update: save the copy carrying the version number, then overwrite the "current" copy.
Connect keeps no copy on the server
Connect synchronises cells and formatting in real time between machines — over the LAN or through an MQTT broker. It stores data nowhere: no server-side database, no snapshot on disk.
Which means: the workbook on each machine is the only backup there is. At the end of a teamwork session, everyone must press Ctrl+S themselves. Disconnect without saving and the work is gone.
Layer 4 — Custom scripts and action sequences
VBA macros
Workbook contains VBA → backing up the workbook backs up the macros.
To keep the macros separately: Excel → Developer → Visual Basic → File → Export File → save the .bas / .cls files into a Scripts\ folder.
Auto Click sequences
Auto Click does not save to a separate file. The click sequence is written as a table directly on the active sheet, in five columns STT / Timestamp (ms) / X / Y / Wait (ms).
To keep a sequence you use often: leave that sheet in the workbook and save the workbook, or copy the table into a separate "action-sequence library" workbook. Remember to add a note about the screen resolution and window position at recording time — playback uses absolute coordinates, so a different screen means the clicks land in the wrong place.
PowerShell automation scripts
Put the scripts in a shared folder and place it under Git:
cd //Cloud/DVDAddin_Master/Scripts
git init
git add .
git commit -m "Initial backup"Every script edit → git commit → you have history.
Disaster recovery scenario
Scenario 1: Machine failure — reinstall Windows
Restore steps:
- Install Windows + Excel.
- Install DVDAddin (the latest installer, taken from the Download Tool command on another machine, or from the download page).
- Close Excel completely before running the installer — an open Excel locks the
.xllfile and the installer reports an error. - Run the restore script above:
settings.regbrings back all Preferences, API keys and shortcuts;lang.txtbrings back the UI language;TCVN-Custom.jsonbrings back the standards you added yourself. - Open Excel → DVD Addin tab → License → sign in again with your email/password (the old license.dat does not work on the new machine).
- Restore the workbooks from the cloud / archive zip.
Time to recover: 30-60 minutes if the backup is good.
Scenario 2: Ransomware encrypts the files
Worst case:
- The workbook files are encrypted → all data lost if there is no copy.
- A local backup on the same machine can be encrypted along with them.
Mitigation:
- Off-site / cloud backup (out of the ransomware's reach).
- OneDrive Version History can restore a version from before the encryption.
Scenario 3: An Excel update breaks the add-in
Fix:
- Disable DVDAddin temporarily: File → Options → Add-ins → Manage: Excel Add-ins → Go → untick DVDAddin.
- Wait for an add-in patch, or roll back to the previous Excel build if your environment allows it.
- In the meantime the workbooks still open, they just lack the add-in features.
Fixed it but "the error is still there"?
Excel keeps the add-in's code in memory until it shuts down completely. Install a new build while Excel is running and the old build keeps running. Close all Excel windows (check in Task Manager that no EXCEL.EXE is left), install, then reopen.
Scenario 4: You accidentally ran a bulk-write command
There is no Undo. Three ways out, in order:
- Close the workbook without saving → reopen the copy on disk.
- OneDrive/SharePoint → Version history → restore the previous version.
- Weekly archive zip.
If none of the three is available, there is nothing left to do — which is why this section belongs on the backup page.
Backup automation
All-in-one backup script
# backup-all.ps1
$ErrorActionPreference = 'Continue'
$today = Get-Date -Format 'yyyy-MM-dd'
$root = "D:\Backup\$today"
New-Item -ItemType Directory -Path $root -Force | Out-Null
# 1. Add-in state
New-Item -ItemType Directory -Path "$root\DVDAddin" -Force | Out-Null
Copy-Item "$env:LOCALAPPDATA\DVDAddin\*" "$root\DVDAddin" -Recurse -Force -ErrorAction SilentlyContinue
Copy-Item "$env:APPDATA\DVDAddin\*" "$root\DVDAddin" -Recurse -Force -ErrorAction SilentlyContinue
reg export "HKCU\Software\DVD\DVDAddin" "$root\DVDAddin\settings.reg" /y
# 2. Project workbooks
if (Test-Path 'D:\Projects') {
Compress-Archive -Path 'D:\Projects\*' -DestinationPath "$root\projects.zip" -Force
}
# 3. Shared master data + scripts
if (Test-Path '\\Cloud\DA_MasterData') {
Compress-Archive -Path '\\Cloud\DA_MasterData\*' -DestinationPath "$root\master.zip" -Force
}
# 4. Clean up old backups (keep 8 weeks)
Get-ChildItem 'D:\Backup' -Directory |
Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-56) } |
Remove-Item -Recurse -Force
Write-Output "Backup done at $root"Schedule
Task Scheduler:
- Trigger: Weekly Sunday 11PM.
- Action:
PowerShell -File D:\Scripts\backup-all.ps1. - Settings: Run whether user logged on or not.
Notification on failure
try {
# backup logic
} catch {
Send-MailMessage -To '[email protected]' -Subject 'Backup FAILED' `
-Body $_.Exception.Message -SmtpServer 'smtp.company.com'
}Restore checklist
When rebuilding a machine:
- [ ] Install Windows + Excel.
- [ ] Close every Excel instance, then install DVDAddin.
- [ ] Copy
%LocalAppData%\DVDAddin\and%APPDATA%\DVDAddin\back. - [ ]
reg import settings.reg. - [ ] Open Excel → both tabs are there: DVD Addin and DVD Cons.
- [ ] License (DVD Addin › About) → sign in again → the status shows the right edition (STANDARD or PRO).
- [ ] Try a command that needs no license: Remove extra spaces (DVD Addin › Text and Number › Text ops).
- [ ] Try a command that needs a license: Quick Input or Batch print.
- [ ] Try a command that needs an API key: open Translate and pick the Gemini or ChatGPT service (the Google route needs no key, so it proves nothing) — a missing-key message means
settings.regdid not go in. - [ ] Restore the workbooks from cloud / archive.
→ Done: the new machine is exactly like the old one.
Related
- Best Practices — general tips.
- Customization → Registry tree — every key in detail.
- Security & Privacy — why the
settings.regfile is sensitive data. - License — moving the license to another machine.
- Connect — why a teamwork session does not save itself.
- Migration — moving from xlam to xll.