[{"data":1,"prerenderedAt":466},["ShallowReactive",2],{"blog-prompts/database-backup-setup":3},{"id":4,"title":5,"body":6,"category":445,"date":446,"dateModified":447,"description":448,"draft":449,"extension":450,"faq":451,"featured":449,"headerVariant":452,"image":451,"keywords":451,"meta":453,"navigation":454,"ogDescription":455,"ogTitle":451,"path":456,"readTime":451,"schemaOrg":457,"schemaType":458,"seo":459,"sitemap":460,"stem":461,"tags":462,"twitterCard":464,"__hash__":465},"blog/blog/prompts/database-backup-setup.md","Database Backup Setup with AI Prompts",{"type":7,"value":8,"toc":435},"minimark",[9,16,21,29,106,110,113,176,180,183,257,267,271,274,356,365,381,385,388,409,423],[10,11,12],"tldr",{},[13,14,15],"p",{},"Backups are your last line of defense against data loss. These prompts help you set up automated backups, configure retention policies, and test restoration procedures. A backup you haven't tested is not a backup.",[17,18,20],"h2",{"id":19},"automated-backup-scripts","Automated Backup Scripts",[13,22,23,24,28],{},"Copy this prompt to generate a complete PostgreSQL backup automation pipeline. Your AI will produce a ",[25,26,27],"code",{},"pg_dump"," script with gzip compression, cloud storage upload, retention policies (7 daily, 4 weekly, 12 monthly), cron scheduling, and failure notifications.",[30,31,33,36,39,58,61,79,82,103],"prompt-box",{"title":32},"PostgreSQL Backup Script",[13,34,35],{},"Create an automated backup script for PostgreSQL.",[13,37,38],{},"Requirements:",[40,41,42,46,49,52,55],"ol",{},[43,44,45],"li",{},"Daily full backups",[43,47,48],{},"Compress backups with gzip",[43,50,51],{},"Upload to S3/R2/cloud storage",[43,53,54],{},"Retention: 7 daily, 4 weekly, 12 monthly",[43,56,57],{},"Notification on failure (email/Slack)",[13,59,60],{},"Include:",[62,63,64,67,70,73,76],"ul",{},[43,65,66],{},"Backup script with pg_dump",[43,68,69],{},"Cron job configuration",[43,71,72],{},"Upload to cloud storage",[43,74,75],{},"Cleanup script for old backups",[43,77,78],{},"Verification that backup completed",[13,80,81],{},"Environment:",[62,83,84,91,97],{},[43,85,86,87],{},"Database: ",[88,89,90],"span",{},"local/RDS/Supabase/Neon",[43,92,93,94],{},"Storage: ",[88,95,96],{},"AWS S3/Cloudflare R2/GCS",[43,98,99,100],{},"Server: ",[88,101,102],{},"Linux/Docker",[13,104,105],{},"Handle credentials securely via environment variables.",[17,107,109],{"id":108},"managed-database-backups","Managed Database Backups",[13,111,112],{},"Use this prompt to configure backups on your managed database platform (Supabase, PlanetScale, Neon, or Railway). Your AI will explain included backup features, set up point-in-time recovery, export to external storage, and create an emergency restoration runbook.",[30,114,116,119,125,128,145,148,159,162,173],{"title":115},"Managed DB Backup Config",[13,117,118],{},"Configure backups for my managed database.",[13,120,121,122],{},"Platform: ",[88,123,124],{},"Supabase/PlanetScale/Neon/Railway/Render",[13,126,127],{},"Help me:",[40,129,130,133,136,139,142],{},[43,131,132],{},"Understand included backup features",[43,134,135],{},"Configure backup retention period",[43,137,138],{},"Set up point-in-time recovery if available",[43,140,141],{},"Export backups to my own storage",[43,143,144],{},"Document restoration procedure",[13,146,147],{},"For Supabase specifically:",[62,149,150,153,156],{},[43,151,152],{},"Enable and configure daily backups",[43,154,155],{},"Set up PITR (Point-in-Time Recovery)",[43,157,158],{},"Export to external S3 bucket",[13,160,161],{},"For PlanetScale:",[62,163,164,167,170],{},[43,165,166],{},"Understand branch-based backup model",[43,168,169],{},"Create production branch protection",[43,171,172],{},"Document restore process",[13,174,175],{},"Create a runbook for restoration in emergency.",[17,177,179],{"id":178},"test-restoration","Test Restoration",[13,181,182],{},"This prompt asks your AI to build an automated backup verification process. You'll get a script that restores backups to a test database, runs verification queries comparing row counts to production, and outputs a report with restoration time and data integrity results.",[30,184,186,189,192,209,212,226,229,240,243],{"title":185},"Backup Testing Script",[13,187,188],{},"Create a backup testing and verification process.",[13,190,191],{},"Test procedure should:",[40,193,194,197,200,203,206],{},[43,195,196],{},"Download latest backup",[43,198,199],{},"Restore to a test database",[43,201,202],{},"Run verification queries",[43,204,205],{},"Compare row counts to production",[43,207,208],{},"Report results",[13,210,211],{},"Verification queries:",[62,213,214,217,220,223],{},[43,215,216],{},"Count rows in critical tables",[43,218,219],{},"Check for recent data (last 24h records exist)",[43,221,222],{},"Verify indexes are present",[43,224,225],{},"Test a sample query performance",[13,227,228],{},"Schedule:",[62,230,231,234,237],{},[43,232,233],{},"Weekly automated restore test",[43,235,236],{},"Monthly manual verification",[43,238,239],{},"Document time-to-restore metrics",[13,241,242],{},"Output a report showing:",[62,244,245,248,251,254],{},[43,246,247],{},"Backup size and date",[43,249,250],{},"Restoration time",[43,252,253],{},"Verification results",[43,255,256],{},"Any warnings or issues",[258,259,260],"warning-box",{},[13,261,262,266],{},[263,264,265],"strong",{},"Untested backups aren't backups:"," Many teams discover their backups are corrupted or incomplete only when they need them. Test your restoration process regularly and document the steps.",[17,268,270],{"id":269},"disaster-recovery-plan","Disaster Recovery Plan",[13,272,273],{},"Paste this prompt to generate a comprehensive disaster recovery plan for your database. Your AI will create step-by-step runbooks for five scenarios (accidental deletion, corruption, provider outage, security breach, infrastructure loss) with RPO/RTO definitions and communication templates.",[30,275,277,280,283,300,303,320,323,331,334,353],{"title":276},"DR Planning",[13,278,279],{},"Create a disaster recovery plan for my database.",[13,281,282],{},"Scenarios to plan for:",[40,284,285,288,291,294,297],{},[43,286,287],{},"Accidental data deletion",[43,289,290],{},"Database corruption",[43,292,293],{},"Provider outage",[43,295,296],{},"Security breach requiring restore",[43,298,299],{},"Complete infrastructure loss",[13,301,302],{},"For each scenario, document:",[40,304,305,308,311,314,317],{},[43,306,307],{},"Detection method",[43,309,310],{},"Immediate response steps",[43,312,313],{},"Restoration procedure",[43,315,316],{},"Verification steps",[43,318,319],{},"Communication template",[13,321,322],{},"Define:",[62,324,325,328],{},[43,326,327],{},"RPO (Recovery Point Objective): max data loss acceptable",[43,329,330],{},"RTO (Recovery Time Objective): max downtime acceptable",[13,332,333],{},"Current setup:",[62,335,336,341,347],{},[43,337,86,338],{},[88,339,340],{},"type and provider",[43,342,343,344],{},"Backup frequency: ",[88,345,346],{},"current",[43,348,349,350],{},"Backup location: ",[88,351,352],{},"where stored",[13,354,355],{},"Create a step-by-step runbook for each scenario.",[357,358,359],"tip-box",{},[13,360,361,364],{},[263,362,363],{},"Pro tip:"," Store backups in a different region and different cloud provider than your primary database. If AWS us-east-1 goes down, your backups shouldn't be there too.",[366,367,368,375],"faq-section",{},[369,370,372],"faq-item",{"question":371},"How often should I backup my database?",[13,373,374],{},"Depends on your RPO. Daily is minimum for most apps. High-traffic apps might need continuous WAL archiving or PITR. Consider how much data you can afford to lose.",[369,376,378],{"question":377},"Should I encrypt my backups?",[13,379,380],{},"Yes. Backups contain all your data including sensitive information. Encrypt at rest (storage-level) and in transit. Many cloud storage options encrypt by default.",[17,382,384],{"id":383},"further-reading","Further Reading",[13,386,387],{},"Want to understand the vulnerability before fixing it? These guides explain what's happening and why.",[62,389,390,397,403],{},[43,391,392],{},[393,394,396],"a",{"href":395},"/blog/vulnerabilities/exposed-api-keys","Understanding exposed API keys",[43,398,399],{},[393,400,402],{"href":401},"/blog/how-to/hide-api-keys","How to hide API keys step-by-step",[43,404,405],{},[393,406,408],{"href":407},"/blog/best-practices/secrets","Secret management best practices",[410,411,412,418],"related-articles",{},[413,414],"related-card",{"description":415,"href":416,"title":417},"Track data changes","/blog/prompts/add-database-audit","Add Database Audit",[413,419],{"description":420,"href":421,"title":422},"Protect sensitive data","/blog/prompts/encrypt-database-fields","Encrypt Database Fields",[424,425,428,432],"cta-box",{"href":426,"label":427},"/","Start Free Scan",[17,429,431],{"id":430},"check-your-backup-status","Check Your Backup Status",[13,433,434],{},"Verify your backup configuration and test restoration.",{"title":436,"searchDepth":437,"depth":437,"links":438},"",2,[439,440,441,442,443,444],{"id":19,"depth":437,"text":20},{"id":108,"depth":437,"text":109},{"id":178,"depth":437,"text":179},{"id":269,"depth":437,"text":270},{"id":383,"depth":437,"text":384},{"id":430,"depth":437,"text":431},"prompts","2026-02-16","2026-03-06","AI prompts to set up database backups. Configure automated backups, test restoration, and implement disaster recovery for PostgreSQL, MySQL, and managed databases.",false,"md",null,"cyan",{},true,"AI prompts to configure automated database backups and disaster recovery.","/blog/prompts/database-backup-setup","[object Object]","BlogPosting",{"title":5,"description":448},{"loc":456},"blog/prompts/database-backup-setup",[463],"Database","summary_large_image","6VzkcujLXgof6NFRLIbTlEAoP5F04WVUwLfzj4fffDg",1775843938785]