Module 14 Lesson 5: Backup and Recovery Strategies
Protecting your models. How to back up your custom GGUFs and RAG databases for total system resilience.
Disaster Recovery: Protecting Your Work
You have spent weeks indexing documents and months fine-tuning your custom models. What happens if your SSD dies? Because everything is "local," you are responsible for your own safety net.
1. Backing up the "Brains" (Models)
The ~/.ollama/models folder contains two things:
- Blobs: The massive 5GB+ files.
- Manifests: The tiny metadata files that tell Ollama which blobs make which model.
The Strategy: Simply copying the models folder to an external drive is a valid backup. If you move this folder to a new computer, Ollama will instantly recognize every model you had.
2. Backing up the "Memory" (Vector DB)
If you use RAG (Module 10), your ChromaDB or SQLite database is the most valuable part of your system.
- The Catch: You cannot just copy-paste a database file while it is "In Use."
- The Fix:
- Stop your Python script.
- Compress the database folder into a
.zipor.tar.gz. - Upload to a secure cloud storage (like AWS S3 or Google Drive) with encryption.
3. Backing up the "DNA" (Modelfiles)
The most important thing to back up is your Modelfiles. These are tiny text files, but they contain the logic of your setup.
- The Strategy: Put them in GitHub. If everything else fails, you can rebuild any model in minutes if you have the Modelfile.
4. The "Hot-Swap" Recovery Plan
For professional apps, follow the 3-2-1 Rule:
- 3 copies of your data (Production, Local Backup, Offsite Backup).
- 2 different types of media (SSD, Cloud Storage).
- 1 offsite location (Physical storage away from your office).
Recovery Exercise: Once every 6 months, try to set up Ollama on a brand new laptop using ONLY your backups. If you can't be up and running in 30 minutes, your backup plan is too complex.
5. Summary Backup Checklist
- Modelfiles: Synced to Git.
- Blobs: Mirrored to an external SSD.
- Vector DB: Compressed and encrypted daily.
- Python/JS Code: Pushed to a private repository.
Key Takeaways
- Modelfiles are the most critical, lightweight backup.
- Vector Databases require specialized "Offline" backup steps.
- Content-addressable storage (blobs) makes Ollama easy to mirror.
- A backup is only a backup if you have successfully restored it before.