{"id":"1c311b8a-0c72-4702-9ac8-21fe32d3b8af","shortId":"z799MR","kind":"skill","title":"odoo-backup-strategy","tagline":"Complete Odoo backup and restore strategy: database dumps, filestore backup, automated scheduling, cloud storage upload, and tested restore procedures.","description":"# Odoo Backup Strategy\n\n## Overview\n\nA complete Odoo backup must include both the **PostgreSQL database** and the **filestore** (attachments, images). This skill covers manual and automated backup procedures, offsite storage, and the correct restore sequence to bring a down Odoo instance back online.\n\n## When to Use This Skill\n\n- Setting up a backup strategy for a production Odoo instance.\n- Automating daily backups with shell scripts and cron.\n- Restoring Odoo after a server failure or data corruption event.\n- Diagnosing a failed backup or corrupt restore.\n\n## How It Works\n\n1. **Activate**: Mention `@odoo-backup-strategy` and describe your server environment.\n2. **Generate**: Receive a complete backup script tailored to your setup.\n3. **Restore**: Get step-by-step restore instructions for any failure scenario.\n\n## Examples\n\n### Example 1: Manual Database + Filestore Backup\n\n```bash\n#!/bin/bash\n# backup_odoo.sh\n\nDATE=$(date +%Y%m%d_%H%M%S)\nDB_NAME=\"odoo\"\nDB_USER=\"odoo\"\nFILESTORE_PATH=\"/var/lib/odoo/.local/share/Odoo/filestore/$DB_NAME\"\nBACKUP_DIR=\"/backups/odoo\"\n\nmkdir -p \"$BACKUP_DIR\"\n\n# Step 1: Dump the database\npg_dump -U $DB_USER -Fc $DB_NAME > \"$BACKUP_DIR/db_$DATE.dump\"\n\n# Step 2: Archive the filestore\ntar -czf \"$BACKUP_DIR/filestore_$DATE.tar.gz\" -C \"$FILESTORE_PATH\" .\n\necho \"✅ Backup complete: db_$DATE.dump + filestore_$DATE.tar.gz\"\n```\n\n### Example 2: Automate with Cron (daily at 2 AM)\n\n```bash\n# Run: crontab -e\n# Add this line:\n0 2 * * * /opt/scripts/backup_odoo.sh >> /var/log/odoo_backup.log 2>&1\n```\n\n### Example 3: Upload to S3 (after backup)\n\n```bash\n# Add to backup script after tar command:\naws s3 cp \"$BACKUP_DIR/db_$DATE.dump\"        s3://my-odoo-backups/db/\naws s3 cp \"$BACKUP_DIR/filestore_$DATE.tar.gz\" s3://my-odoo-backups/filestore/\n\n# Optional: Delete local backups older than 7 days\nfind \"$BACKUP_DIR\" -type f -mtime +7 -delete\n```\n\n### Example 4: Full Restore Procedure\n\n```bash\n# Step 1: Stop Odoo\ndocker compose stop odoo  # or: systemctl stop odoo\n\n# Step 2: Recreate and restore the database\n# (--clean alone fails if the DB doesn't exist; drop and recreate first)\ndropdb -U odoo odoo 2>/dev/null || true\ncreatedb -U odoo odoo\npg_restore -U odoo -d odoo db_YYYYMMDD_HHMMSS.dump\n\n# Step 3: Restore the filestore\nFILESTORE=/var/lib/odoo/.local/share/Odoo/filestore/odoo\nrm -rf \"$FILESTORE\"/*\ntar -xzf filestore_YYYYMMDD_HHMMSS.tar.gz -C \"$FILESTORE\"/\n\n# Step 4: Restart Odoo\ndocker compose start odoo\n\n# Step 5: Verify — open Odoo in the browser and check:\n#   - Can you log in?\n#   - Are recent records visible?\n#   - Are file attachments loading?\n```\n\n## Best Practices\n\n- ✅ **Do:** Test restores monthly in a staging environment — a backup you've never restored is not a backup.\n- ✅ **Do:** Follow the **3-2-1 rule**: 3 copies, 2 different media types, 1 offsite copy (e.g., S3 or a remote server).\n- ✅ **Do:** Back up **immediately before every Odoo upgrade** — this is your rollback point.\n- ✅ **Do:** Verify backup integrity: `pg_restore --list backup.dump` should complete without errors.\n- ❌ **Don't:** Back up only the database without the filestore — all attachments and images will be missing after a restore.\n- ❌ **Don't:** Store backups on the same disk or same server as Odoo — a disk or server failure destroys both.\n- ❌ **Don't:** Run `pg_restore --clean` against a non-existent database — always create the database first.\n\n## Limitations\n\n- Does not cover **Odoo.sh built-in backups** — Odoo.sh has its own backup system accessible from the dashboard.\n- This script assumes a **single-database** Odoo setup. Multi-database instances require looping over all databases.\n- Filestore path may differ between installations (Docker volume vs. bare-metal). Always verify the path with `odoo-bin shell` before running a restore.\n- Large filestores (100GB+) may require incremental backup tools like `rsync` or `restic` rather than full `tar.gz` archives.","tags":["odoo","backup","strategy","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding"],"capabilities":["skill","source-sickn33","skill-odoo-backup-strategy","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/odoo-backup-strategy","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 34666 github stars · SKILL.md body (3,918 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-23T06:51:40.450Z","embedding":null,"createdAt":"2026-04-18T21:41:41.740Z","updatedAt":"2026-04-23T06:51:40.450Z","lastSeenAt":"2026-04-23T06:51:40.450Z","tsv":"'+7':284 '-1':412 '-2':411 '/backups/odoo':176 '/bin/bash':153 '/dev/null':329 '/my-odoo-backups/db':261 '/my-odoo-backups/filestore':269 '/opt/scripts/backup_odoo.sh':235 '/var/lib/odoo/.local/share/odoo/filestore':171 '/var/lib/odoo/.local/share/odoo/filestore/odoo':348 '/var/log/odoo_backup.log':236 '0':233 '1':109,147,182,238,293,420 '100gb':575 '2':121,198,218,224,234,237,305,328,416 '3':132,240,343,410,414 '4':287,358 '5':366 '7':276 'access':526 'activ':110 'add':230,247 'alon':312 'alway':506,560 'archiv':199,589 'assum':532 'attach':41,385,465 'autom':15,48,81,219 'aw':254,262 'back':64,430,456 'backup':3,7,14,25,31,49,74,83,102,114,126,151,174,179,194,204,211,245,249,257,265,273,279,398,406,444,477,519,524,579 'backup.dump':449 'backup_odoo.sh':154 'bare':558 'bare-met':557 'bash':152,226,246,291 'best':387 'bin':567 'bring':59 'browser':372 'built':517 'built-in':516 'c':207,355 'check':374 'clean':311,499 'cloud':17 'command':253 'complet':5,29,125,212,451 'compos':297,362 'copi':415,422 'correct':55 'corrupt':97,104 'cover':45,514 'cp':256,264 'creat':507 'createdb':331 'cron':88,221 'crontab':228 'czf':203 'd':159,339 'daili':82,222 'dashboard':529 'data':96 'databas':11,37,149,185,310,460,505,509,536,541,547 'date':155,156 'date.dump':196,214,259 'date.tar.gz':206,216,267 'day':277 'db':163,166,172,189,192,213,316 'db_yyyymmdd_hhmmss.dump':341 'delet':271,285 'describ':117 'destroy':492 'diagnos':99 'differ':417,551 'dir':175,180,280 'dir/db_':195,258 'dir/filestore_':205,266 'disk':481,488 'docker':296,361,554 'doesn':317 'drop':320 'dropdb':324 'dump':12,183,187 'e':229 'e.g':423 'echo':210 'environ':120,396 'error':453 'event':98 'everi':434 'exampl':145,146,217,239,286 'exist':319,504 'f':282 'fail':101,313 'failur':94,143,491 'fc':191 'file':384 'filestor':13,40,150,169,201,208,215,346,347,351,356,463,548,574 'filestore_yyyymmdd_hhmmss.tar.gz':354 'find':278 'first':323,510 'follow':408 'full':288,587 'generat':122 'get':134 'h':160 'imag':42,467 'immedi':432 'includ':33 'increment':578 'instal':553 'instanc':63,80,542 'instruct':140 'integr':445 'larg':573 'like':581 'limit':511 'line':232 'list':448 'load':386 'local':272 'log':377 'loop':544 'm':158,161 'manual':46,148 'may':550,576 'media':418 'mention':111 'metal':559 'miss':470 'mkdir':177 'month':392 'mtime':283 'multi':540 'multi-databas':539 'must':32 'name':164,173,193 'never':401 'non':503 'non-exist':502 'odoo':2,6,24,30,62,79,90,113,165,168,295,299,303,326,327,333,334,338,340,360,364,369,435,486,537,566 'odoo-backup-strategi':1,112 'odoo-bin':565 'odoo.sh':515,520 'offsit':51,421 'older':274 'onlin':65 'open':368 'option':270 'overview':27 'p':178 'path':170,209,549,563 'pg':186,335,446,497 'point':441 'postgresql':36 'practic':388 'procedur':23,50,290 'product':78 'rather':585 'receiv':123 'recent':380 'record':381 'recreat':306,322 'remot':427 'requir':543,577 'restart':359 'restic':584 'restor':9,22,56,89,105,133,139,289,308,336,344,391,402,447,473,498,572 'rf':350 'rm':349 'rollback':440 'rsync':582 'rule':413 'run':227,496,570 's3':243,255,260,263,268,424 'scenario':144 'schedul':16 'script':86,127,250,531 'sequenc':57 'server':93,119,428,484,490 'set':71 'setup':131,538 'shell':85,568 'singl':535 'single-databas':534 'skill':44,70 'skill-odoo-backup-strategy' 'source-sickn33' 'stage':395 'start':363 'step':136,138,181,197,292,304,342,357,365 'step-by-step':135 'stop':294,298,302 'storag':18,52 'store':476 'strategi':4,10,26,75,115 'system':525 'systemctl':301 'tailor':128 'tar':202,252,352 'tar.gz':588 'test':21,390 'tool':580 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'true':330 'type':281,419 'u':188,325,332,337 'upgrad':436 'upload':19,241 'use':68 'user':167,190 've':400 'verifi':367,443,561 'visibl':382 'volum':555 'vs':556 'without':452,461 'work':108 'xzf':353 'y':157","prices":[{"id":"8f4a4f41-d6a4-4190-936f-2f7cbfe9263a","listingId":"1c311b8a-0c72-4702-9ac8-21fe32d3b8af","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:41:41.740Z"}],"sources":[{"listingId":"1c311b8a-0c72-4702-9ac8-21fe32d3b8af","source":"github","sourceId":"sickn33/antigravity-awesome-skills/odoo-backup-strategy","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/odoo-backup-strategy","isPrimary":false,"firstSeenAt":"2026-04-18T21:41:41.740Z","lastSeenAt":"2026-04-23T06:51:40.450Z"}],"details":{"listingId":"1c311b8a-0c72-4702-9ac8-21fe32d3b8af","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"odoo-backup-strategy","github":{"repo":"sickn33/antigravity-awesome-skills","stars":34666,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-04-23T06:41:03Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"c984919d00d3f7e8f48ef4f996e895bf97bf4210","skill_md_path":"skills/odoo-backup-strategy/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/odoo-backup-strategy"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"odoo-backup-strategy","description":"Complete Odoo backup and restore strategy: database dumps, filestore backup, automated scheduling, cloud storage upload, and tested restore procedures."},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/odoo-backup-strategy"},"updatedAt":"2026-04-23T06:51:40.450Z"}}