30 - Upgrade Procedure
Overview
Pre-Upgrade Checklist
┌────────────────────────────────────────────────────────────────────────────┐
│ Pre-Upgrade Checklist │
│ │
│ □ 1. Backup databases (db/*.db) │
│ □ 2. Backup .env file │
│ □ 3. Backup custom strategies │
│ □ 4. Note current version │
│ □ 5. Stop running OpenAlgo instance │
│ □ 6. Read release notes for breaking changes │
│ │
└────────────────────────────────────────────────────────────────────────────┘Backup Procedure
Database Backup
# Create backup directory
mkdir -p backups/$(date +%Y%m%d)
# Backup all databases
cp db/openalgo.db backups/$(date +%Y%m%d)/
cp db/logs.db backups/$(date +%Y%m%d)/
cp db/latency.db backups/$(date +%Y%m%d)/
cp db/sandbox.db backups/$(date +%Y%m%d)/
cp db/historify.duckdb backups/$(date +%Y%m%d)/Configuration Backup
Upgrade Steps
Step 1: Stop OpenAlgo
Step 2: Pull Latest Changes
Step 3: Update Dependencies
Step 4: Update Environment
Step 5: Database Initialization
Step 6: Start OpenAlgo
Version-Specific Upgrades
Upgrading to v2.0.0
Database Schema Changes
Rollback Procedure
If Upgrade Fails
Docker Upgrade
Pull New Image
Volume Preservation
Systemd Service Update
For Ubuntu Server
Post-Upgrade Verification
Health Checks
Functional Tests
Changelog Review
Check Release Notes
Troubleshooting
Common Upgrade Issues
Issue
Solution
Reset to Clean State
Automated Upgrade Script
upgrade.sh
Key Files Reference
File
Purpose
Last updated