Octopus
Backup and Recovery
All Octopus SQL data — agents, episodes, procedures, AI functions, and areas — resides in a single SQL Server database. Standard SQL Server backup covers all of it. This page provides a recommended backup schedule and a step-by-step recovery procedure.
What Is Covered by SQL Server Backup
| Data | Table(s) | Criticality |
|---|---|---|
| Agent configurations | Octopus_Agents | Critical — losing this loses all agents |
| Conversation history | Octopus_Episodes, Octopus_EpisodeMessages | High — long-term user context |
| Procedural memory | Octopus_Procedures | High — defines agent skill sequences |
| AI Functions | Octopus_AIFunctions | High — runtime-editable tool logic |
| Areas | Octopus_Areas | Critical — controls agent routing and access |
Vector store not included. Semantic memory (document embeddings) is stored in Qdrant or PGVector — not in SQL Server. Back up the vector store separately. See the SemanticKernelPlugin guide for vector backup procedures.
Recommended Backup Schedule
-- Full database backup: daily at midnight
BACKUP DATABASE [OctopusAI]
TO DISK = N'\\backup-server\octopus\full\OctopusAI_full.bak'
WITH
COMPRESSION,
CHECKSUM,
STATS = 10;
-- Differential backup: every 6 hours
BACKUP DATABASE [OctopusAI]
TO DISK = N'\\backup-server\octopus\diff\OctopusAI_diff.bak'
WITH
DIFFERENTIAL,
COMPRESSION,
CHECKSUM;
-- Transaction log backup: every 15 minutes (for point-in-time recovery)
BACKUP LOG [OctopusAI]
TO DISK = N'\\backup-server\octopus\log\OctopusAI_log.bak'
WITH COMPRESSION, CHECKSUM;
Azure SQL Backup (Managed Service)
If using Azure SQL Database, automated backups are configured via the Azure portal:
# Azure CLI — configure backup retention
az sql db ltr-policy set \
--resource-group myRG \
--server myserver \
--database OctopusAI \
--weekly-retention P4W \
--monthly-retention P12M \
--yearly-retention P5Y \
--week-of-year 1
Recovery Procedure
1
Stop the Octopus application instances
Prevent new writes while the restore is in progress.
2
Restore the full backup
RESTORE DATABASE [OctopusAI] FROM DISK = '...\OctopusAI_full.bak' WITH NORECOVERY
3
Apply differential backups (if any)
RESTORE DATABASE [OctopusAI] FROM DISK = '...\OctopusAI_diff.bak' WITH NORECOVERY
4
Apply transaction log backups to target point-in-time
RESTORE LOG [OctopusAI] FROM DISK = '...' WITH RECOVERY, STOPAT = '2024-06-15 14:30:00'
5
Verify schema is consistent
Run
dotnet ef migrations list to confirm schema matches the application version.
6
Restart Octopus application instances
Application will verify connectivity on startup and resume serving requests.
Recovery Time Objectives
| Scenario | RPO (data loss) | RTO (downtime) |
|---|---|---|
| Full restore from daily backup | Up to 24 hours | 15–60 min depending on DB size |
| Full + differential restore | Up to 6 hours | 15–30 min |
| Full + differential + log restore | Up to 15 min | 20–45 min |
| Azure SQL point-in-time restore | Up to 5–8 min | 5–15 min |