My_Backup System
Section titled “My_Backup System”1. Overview
Section titled “1. Overview”This is a “World Class” backup solution using Kopia, a modern, enterprise-grade tool wrapped in a custom automation script. It is superior in every way to my previous cycling of ZIP files, for efficiency, risk management, and speed.
Key Benefits:
- Split-Brain Architecture: It intelligently separates “Critical/Active” data (Documents, Code, Databases) from “Bulk/Static” data (Photos, Videos, PDFs) that don’t change much.
- Free Cloud Backup: By isolating critical data, we can fit the most important business files (~5GB) onto free cloud storage (Google Drive), while keeping massive files (~1TB) on local drives (NAS/USB).
- Encrypted & Deduplicated: All data is military-grade encrypted.
2. The Strategy: Efficient Folder Structure
Section titled “2. The Strategy: Efficient Folder Structure”The secret to a fast, free, and robust backup system is how you organize your files. We separate data into two categories:
- Active (Critical): Small files, text documents, code, financial data. Things that change often and are vital to life/business.
- Static (Bulk): Large files, photos, videos, software installers, finished project archives. Things that rarely change and take up massive space.
The Recommended Structure
Section titled “The Recommended Structure”To make this automation work, create a folder named Static inside any main category. The system is trained to automatically treat that folder differently.
D:\ (Data Drive)├── FSS (Business)│ ├── Accounting [ACTIVE] -> Goes to Cloud + Local│ ├── Documents [ACTIVE] -> Goes to Cloud + Local│ └── Static [STATIC] -> Local Only (NAS/USB)│ ├── Software_ISOs (Huge files)│ └── Old_Project_Archives│└── Ta (Personal) ├── Financials [ACTIVE] -> Goes to Cloud + Local ├── Writings [ACTIVE] -> Goes to Cloud + Local └── Static [STATIC] -> Local Only (NAS/USB) ├── Photos (200GB+) └── Videos (500GB+)The Rule: If a folder grows larger than 500MB and contains content that doesn’t change (like vacation photos), move it into Static.
If you don’t have lots of static content (photos, videos, PDFs, etc.), you can implement a simpler single repo solution, for Active/Critical data.
3. Quick Start: Setup Guide
Section titled “3. Quick Start: Setup Guide”Follow these steps to set up the backup system on a new computer.
Step 1: Install Software
Section titled “Step 1: Install Software”- Install Python (Version 3.14 or newer):
- Download: python.org/downloads
- IMPORTANT: Check the box “Add Python to PATH” during install.
- Install ‘uv’ (Script Runner):
- Open Command Prompt (
cmd) and type:pip install uv
- Open Command Prompt (
- Install Kopia CLI (The Engine):
- Download Windows 64-bit CLI (zip) from: github.com/kopia/kopia/releases
- Extract and move
kopia.exeto:C:\Program Files\KopiaCLI\kopia.exe - Add to System PATH: Search Windows for “Environment Variables” -> Path -> New -> Paste
C:\Program Files\KopiaCLI\.
Step 2: Prepare the Script Folder
Section titled “Step 2: Prepare the Script Folder”- Create a folder (e.g.,
D:\Backups\Scripts). - Place
my_backup.pyandmy_backup.yamlhere. - Create a file named
.envand add your password/paths:Warning: If you lose this password, your data is lost forever.KOPIA_PASSWORD=MySecretPassword123!GDRIVE_PATH=G:/My Drive
Step 3: Initialize Repositories (One Time Only)
Section titled “Step 3: Initialize Repositories (One Time Only)”Because we use the “Split-Brain” strategy, we initialize two separate databases. Run these commands in Command Prompt:
1. Create the Critical (Cloud) Repo:
kopia repository create filesystem --path=D:\bak\Kopia_Active --config-file=D:\bak\Kopia_Active\kopia.config2. Create the Static (Local) Repo:
kopia repository create filesystem --path=D:\bak\Kopia_Static --config-file=D:\bak\Kopia_Static\kopia.configStep 4: Set Retention Policies
Section titled “Step 4: Set Retention Policies”Tell Kopia how long to keep history.
- Active Data (Keep 10 years):
Terminal window kopia policy set --global --keep-daily 10 --keep-weekly 10 --keep-monthly 12 --keep-annual 10 --config-file=D:\bak\Kopia_Active\kopia.config - Static Data (Keep 3 years - saves space):
Terminal window kopia policy set --global --keep-daily 10 --keep-weekly 4 --keep-monthly 12 --keep-annual 3 --config-file=D:\bak\Kopia_Static\kopia.config
Step 5: Automate (Task Scheduler)
Section titled “Step 5: Automate (Task Scheduler)”- Open Task Scheduler -> Create Task.
- General: Name: “Daily Backup”. Check “Run whether user is logged on or not”.
- Triggers: Daily at 2:00 AM.
- Actions: Start a program.
- Program:
uv - Arguments:
run "D:\Path\To\Scripts\my_backup.py"
- Program:
4. User Responsibilities
Section titled “4. User Responsibilities”- Nothing. Runs automatically.
- Monitor: If the script detects missing critical files (e.g., QuickBooks hasn’t been saved in 7 days), the script will alert you.
Periodic
Section titled “Periodic”- External Drives: Ensure your backup drives (NAS/USB) are connected. The script automatically mirrors data to them when found.
- Housekeeping: If you dump a large amount of new media (photos/videos) onto your computer, ensure you put them inside a
Staticfolder so they don’t clog up the Cloud backup.
5. How to Restore Files (KopiaUI)
Section titled “5. How to Restore Files (KopiaUI)”Use the visual interface to browse and restore files.
- Open KopiaUI (Download from Kopia.io).
- Connect:
- Choose Filesystem.
- Path: Browse to either
D:\bak\Kopia_Active(Docs) orD:\bak\Kopia_Static(Media). - Config File: You must point to the specific config file inside that folder (e.g.,
D:\bak\Kopia_Active\kopia.config). - Enter Password.
- Mount: Click “Mount” next to a snapshot. It appears as a drive letter (Z:).
- Restore: Copy files out using Windows Explorer.
6. Troubleshooting
Section titled “6. Troubleshooting”- KopiaUI Won’t Open: Check the System Tray (near the clock). It starts minimized. Kill “KopiaUI” in Task Manager if stuck.
- Backup “Stalled” or “Huge”: If the Active backup is taking hours or is larger than 10GB, you likely put large video/photo files in a folder not named
Static. Move them toStaticor update the.kopiaignorefile in that directory. - File Locked Errors: If Kopia complains about open files (like
.ecofiles), ensure the.kopiaignorefile in the source folder includes**/*.ecoor similar exclusions for temp files.Here is the fully updated Knowledge Base Note. - “System cannot find the file specified” error was caused by broken symbolic links for .kopiaignore files in source directories. Robust self-repair steps were added to my_backup.py that automatically detects and fixes these links by replacing them with the correct files.
I have integrated the “Split-Repo” architecture we just built into the instructions. This is critical because the single-repo instructions would no longer work with your new Python script.
I also added the “Data Strategy” section early on, which explains the “Active vs. Static” philosophy and includes the visual structure.
my_backup System
Section titled “my_backup System”1. Overview
Section titled “1. Overview”This system is a “World Class” backup solution that replaces manual copying or ZIP files. It uses Kopia, a modern, enterprise-grade tool wrapped in a custom automation script.
Key Benefits:
- Split-Brain Architecture: It intelligently separates “Critical” data (Documents, Code, Databases) from “Bulk” data (Photos, Videos, Installers).
- Free Cloud Backup: By isolating critical data, we can fit the most important business files (~5GB) onto free cloud storage (Google Drive), while keeping massive files (~1TB) on local drives (NAS/USB).
- Encrypted & Deduplicated: All data is military-grade encrypted.
2. The Strategy: Efficient Folder Structure
Section titled “2. The Strategy: Efficient Folder Structure”The secret to a fast, free, and robust backup system is how you organize your files. We separate data into two categories:
- Active (Critical): Small files, text documents, code, financial data. Things that change often and are vital to life/business.
- Static (Bulk): Large files, photos, videos, software installers, finished project archives. Things that rarely change and take up massive space.
The Recommended Structure
Section titled “The Recommended Structure”To make this automation work, create a folder named Static inside any main category. The system is trained to automatically treat that folder differently.
D:\ (Data Drive)├── FSS (Business)│ ├── Accounting [ACTIVE] -> Goes to Cloud + Local│ ├── Documents [ACTIVE] -> Goes to Cloud + Local│ └── Static [STATIC] -> Local Only (NAS/USB)│ ├── Software_ISOs (Huge files)│ └── Old_Project_Archives│└── Ta (Personal) ├── Financials [ACTIVE] -> Goes to Cloud + Local ├── Writings [ACTIVE] -> Goes to Cloud + Local └── Static [STATIC] -> Local Only (NAS/USB) ├── Photos (200GB+) └── Videos (500GB+)The Rule: If a folder grows larger than 500MB and contains content that doesn’t change (like vacation photos), move it into Static.
3. Quick Start: Setup Guide
Section titled “3. Quick Start: Setup Guide”Follow these steps to set up the backup system on a new computer.
Step 1: Install Software
Section titled “Step 1: Install Software”- Install Python (Version 3.14 or newer):
- Download: python.org/downloads
- IMPORTANT: Check the box “Add Python to PATH” during install.
- Install ‘uv’ (Script Runner):
- Open Command Prompt (
cmd) and type:pip install uv
- Open Command Prompt (
- Install Kopia CLI (The Engine):
- Download Windows 64-bit CLI (zip) from: github.com/kopia/kopia/releases
- Extract and move
kopia.exeto:C:\Program Files\KopiaCLI\kopia.exe - Add to System PATH: Search Windows for “Environment Variables” -> Path -> New -> Paste
C:\Program Files\KopiaCLI\.
Step 2: Prepare the Script Folder
Section titled “Step 2: Prepare the Script Folder”- Create a folder (e.g.,
D:\Backups\Scripts). - Place
my_backup.pyandmy_backup.yamlhere. - Create a file named
.envand add your password/paths:Warning: If you lose this password, your data is lost forever.KOPIA_PASSWORD=MySecretPassword123!GDRIVE_PATH=G:/My Drive
Step 3: Initialize Repositories (One Time Only)
Section titled “Step 3: Initialize Repositories (One Time Only)”Because we use the “Split-Brain” strategy, we initialize two separate databases. Run these commands in Command Prompt:
1. Create the Critical (Cloud) Repo:
kopia repository create filesystem --path=D:\bak\Kopia_Active --config-file=D:\bak\Kopia_Active\kopia.config2. Create the Static (Local) Repo:
kopia repository create filesystem --path=D:\bak\Kopia_Static --config-file=D:\bak\Kopia_Static\kopia.configStep 4: Set Retention Policies
Section titled “Step 4: Set Retention Policies”Tell Kopia how long to keep history.
- Active Data (Keep 10 years):
Terminal window kopia policy set --global --keep-daily 10 --keep-weekly 10 --keep-monthly 12 --keep-annual 10 --config-file=D:\bak\Kopia_Active\kopia.config - Static Data (Keep 3 years - saves space):
Terminal window kopia policy set --global --keep-daily 10 --keep-weekly 4 --keep-monthly 12 --keep-annual 3 --config-file=D:\bak\Kopia_Static\kopia.config
Step 5: Automate (Task Scheduler)
Section titled “Step 5: Automate (Task Scheduler)”- Open Task Scheduler -> Create Task.
- General: Name: “Daily Backup”. Check “Run whether user is logged on or not”.
- Triggers: Daily at 2:00 AM.
- Actions: Start a program.
- Program:
uv - Arguments:
run "D:\Path\To\Scripts\my_backup.py"
- Program:
4. User Responsibilities
Section titled “4. User Responsibilities”- Nothing. Runs automatically.
- Monitor: If the script detects missing critical files (e.g., QuickBooks hasn’t been saved in 7 days), the script will alert you.
Periodic
Section titled “Periodic”- External Drives: Ensure your backup drives (NAS/USB) are connected. The script automatically mirrors data to them when found.
- Housekeeping: If you dump a large amount of new media (photos/videos) onto your computer, ensure you put them inside a
Staticfolder so they don’t clog up the Cloud backup.
5. How to Restore Files (KopiaUI)
Section titled “5. How to Restore Files (KopiaUI)”Use the visual interface to browse and restore files.
- Open KopiaUI (Download from Kopia.io).
- Connect:
- Choose Filesystem.
- Path: Browse to either
D:\bak\Kopia_Active(Docs) orD:\bak\Kopia_Static(Media). - Config File: You must point to the specific config file inside that folder (e.g.,
D:\bak\Kopia_Active\kopia.config). - Enter Password.
- Mount: Click “Mount” next to a snapshot. It appears as a drive letter (Z:).
- Restore: Copy files out using Windows Explorer.
6. Troubleshooting
Section titled “6. Troubleshooting”- KopiaUI Won’t Open: Check the System Tray (near the clock). It starts minimized. Kill “KopiaUI” in Task Manager if stuck.
- Backup “Stalled” or “Huge”: If the Active backup is taking hours or is larger than 10GB, you likely put large video/photo files in a folder not named
Static. Move them toStaticor update the.kopiaignorefile in that directory. - File Locked Errors: If Kopia complains about open files (like
.ecofiles), ensure the.kopiaignorefile in the source folder includes**/*.ecoor similar exclusions for temp files.