[{"data":1,"prerenderedAt":338},["ShallowReactive",2],{"blog-en-supabase-branching-is-not-a-backup":3},{"id":4,"title":5,"body":6,"category":297,"cover":298,"coverAlt":299,"description":300,"draft":301,"extension":302,"faq":303,"image":318,"keywords":319,"meta":326,"navigation":327,"ogTitle":328,"path":329,"published":330,"seo":331,"stem":332,"tldr":333,"updated":330,"__hash__":337},"blog_en\u002Fblog\u002Fsupabase-branching-is-not-a-backup.md","Supabase branching is not a backup. It only goes forwards.",{"type":7,"value":8,"toc":285},"minimark",[9,13,16,24,29,32,35,38,122,131,135,138,141,144,148,151,154,160,163,167,170,173,199,203,206,209,214,223,227,230,233,240,243,246,249,253,273],[10,11,12],"p",{},"You turned Supabase branching on because it looked like the careful way to work.\nThere is a preview branch beside your project now, changes get tried there before\nanyone sees them, and the whole setup feels a great deal safer than it did last\nmonth.",[10,14,15],{},"It is safer. It is also not a backup, and the difference shows up on exactly one\nday.",[10,17,18,19,23],{},"Here is the part the branching guides skip: ",[20,21,22],"strong",{},"a branch is a second database\nrunning alongside your first, rather than an earlier version of it."," Branching\nis where you go before you make a change. A backup is where you go once one has\nalready gone wrong. Turning branching on does not put a copy of your data\nanywhere.",[25,26,28],"h2",{"id":27},"is-supabase-branching-a-backup","Is Supabase branching a backup?",[10,30,31],{},"No. A branch starts as an empty database wearing your schema, and nothing in\nbranching puts an older version of your data back.",[10,33,34],{},"Supabase's own documentation is direct about it: \"New branches do not start with\nany data from your main project. This is meant to better protect your sensitive\nproduction data.\" A branch is built from your migrations, and a migration\ndescribes the shape of a database. The tables, the columns, the policies. Never\nthe rows.",[10,36,37],{},"So the branch sitting next to your project is not Tuesday's copy of anything. It\nis a new database that has never met your users.",[39,40,41,56],"table",{},[42,43,44],"thead",{},[45,46,47,50,53],"tr",{},[48,49],"th",{},[48,51,52],{},"A Supabase branch",[48,54,55],{},"A backup",[57,58,59,71,89,100,111],"tbody",{},[45,60,61,65,68],{},[62,63,64],"td",{},"Holds your rows from an earlier moment",[62,66,67],{},"Only if you cloned them in",[62,69,70],{},"Yes, that is the entire job",[45,72,73,76,83],{},[62,74,75],{},"Can put production back how it was",[62,77,78],{},[79,80,82],"key-verdict",{"type":81},"danger","Never",[62,84,85],{},[79,86,88],{"type":87},"safe","Yes",[45,90,91,94,97],{},[62,92,93],{},"Lives outside your Supabase account",[62,95,96],{},"No, it is another project inside it",[62,98,99],{},"Depends which of the three routes you took",[45,101,102,105,108],{},[62,103,104],{},"Still there next month",[62,106,107],{},"Only if you made it persistent",[62,109,110],{},"For as long as you keep it",[45,112,113,116,119],{},[62,114,115],{},"What it is for",[62,117,118],{},"Trying a change before it reaches anyone",[62,120,121],{},"Getting back to before something reached anyone",[10,123,124,125,130],{},"If you have never established what is actually copying your database, that is the\njob this article is trying to send you off to do, and\n",[126,127,129],"a",{"href":128},"\u002Fblog\u002Fdoes-supabase-back-up-my-database","which plan you are on settles most of it in two minutes",".",[25,132,134],{"id":133},"what-a-branch-actually-is","What a branch actually is",[10,136,137],{},"A whole second Supabase project, with its own everything.",[10,139,140],{},"\"Each branch is a separate environment with its own Supabase instance and API\ncredentials,\" is how the documentation puts it. Its own connection string, its\nown keys, its own Storage, its own login accounts, its own rows. Nothing inside\nit is wired to the project your users are on, which is precisely what makes it\nsafe to break things in.",[10,142,143],{},"That isolation is the whole feature, and it is also why it cannot double as a\nbackup. The copy of your data you were hoping for was never taken, and the place\nyou would go looking for it has been empty since the day it was created.",[25,145,147],{"id":146},"what-merging-a-branch-does-and-what-it-does-not","What merging a branch does, and what it does not",[10,149,150],{},"It carries your schema changes into production. It never carries rows, in either\ndirection, at any point.",[10,152,153],{},"When you merge, Supabase applies the migrations from your branch to your\nproduction database and deploys your Edge Function changes. That is the entire\npayload. A new table, a new column, a rewritten policy: those travel. The rows\nyou made while testing stay in the branch, and the rows in production stay\nexactly as they were, including the ones you were hoping to replace.",[155,156],"diagram",{"alt":157,"caption":158,"src":159},"Three lanes entering a gate on their way into a production database. A grid of table cells passes through and is ticked. A code block passes through and is ticked. A stack of data rows stops at the gate and is crossed.","A merge deploys the shape of your database and the code around it. The rows are the one thing it was never built to move.","\u002Fblog\u002Fsupabase-branching-is-not-a-backup\u002Fwhat-a-merge-carries-1600x640.png",[10,161,162],{},"People expect a version of this that does not exist: a merge that reaches into\nproduction and puts things back the way they were. What branching has instead is\na deployment, applied forwards, onto whatever happens to be in production at the\ntime.",[25,164,166],{"id":165},"but-i-cloned-my-production-data-into-the-branch","But I cloned my production data into the branch",[10,168,169],{},"Then you have a copy of your rows, and three things about that copy decide what\nit is worth on the day you need it.",[10,171,172],{},"You can do this and it is not obscure. The Supabase CLI documents the flag as\n\"Whether to clone production data to the branch database\", and the Management API\ntakes the same option when it creates a branch. If you used it, your branch\ngenuinely holds your data.",[174,175,176,183,193],"ul",{},[177,178,179,182],"li",{},[20,180,181],{},"It was taken once."," The clone happens when the branch is created and nothing\ntops it up afterwards. Every order, signup and comment since then lives in\nproduction and nowhere else, which is the whole difference between a copy and a\nschedule.",[177,184,185,188,189,130],{},[20,186,187],{},"It is inside the same account."," A branch is another project under the same\norganisation, on the same card, behind the same login. Every way of losing your\nSupabase account takes the branch with it, and\n",[126,190,192],{"href":191},"\u002Fblog\u002Fthree-ways-to-back-up-a-supabase-database","that is a different disaster from breaking your own data",[177,194,195,198],{},[20,196,197],{},"Nobody has read it back."," A clone that half-finished looks identical to one\nthat completed, from the outside, right up until you open it.",[25,200,202],{"id":201},"the-branch-is-the-part-designed-to-disappear","The branch is the part designed to disappear",[10,204,205],{},"A preview branch is deleted when its pull request is merged or closed. That is\nthe documented behaviour of the feature.",[10,207,208],{},"Supabase calls preview branches \"ephemeral and best suited for focused testing\"\nand says they \"are automatically deleted when a PR is merged or closed\". The\nother kind, persistent branches, are \"long-lived and recommended for environments\nlike staging, QA, or development\", and those survive the pull request closing.",[155,210],{"alt":211,"caption":212,"src":213},"Two timelines running left to right, each ending at a break in the line. On the upper one, saved files sit at three earlier points and an arrow curves back from the break to the nearest of them, ticked. On the lower one, a second line splits away and runs alongside carrying an empty database, and an arrow curving back from the break reaches nothing, crossed.","A backup sits behind you on the timeline, at a moment you can name. A branch runs alongside you, and there is nothing behind it to reach for.","\u002Fblog\u002Fsupabase-branching-is-not-a-backup\u002Fbehind-you-beside-you-1600x680.png",[10,215,216,217,130],{},"So on the default setup, the branch holding your only cloned copy is the thing\nyour workflow throws away on the day the work finishes. Keeping it means making\nit persistent, and a persistent branch is a second Supabase project left running.\nSupabase lists branching on the paid plans and bills it per branch, per hour, on\n",[126,218,222],{"href":219,"rel":220},"https:\u002F\u002Fsupabase.com\u002Fpricing",[221],"nofollow","their pricing page",[25,224,226],{"id":225},"what-branching-is-genuinely-good-for","What branching is genuinely good for",[10,228,229],{},"A great deal, and this article would be dishonest without saying so.",[10,231,232],{},"A branch is the cheapest place there is to find out that a migration drops a\ncolumn, before it drops the column your customers are sitting in. It lets you\nrehearse a policy change against a database shaped exactly like yours, with its\nown keys, so a mistake reaches nobody. It gives an AI assistant somewhere to be\nwrong that is not your live app. A backup can do none of that.",[10,234,235,236,130],{},"The gap is in which kind of accident it covers. Branching protects the changes\nthat travel through a pull request. Most of what actually costs people their data\nnever goes near one: a delete in the Supabase table editor that matched more rows\nthan intended, a seed script pointed at the live project, a migration an AI agent\nwrote and you approved at one in the morning, a tidy-up of what looked like test\ndata. Not one of those passes through a branch on its way to production, which is\nthe same reason\n",[126,237,239],{"href":238},"\u002Fblog\u002Fversion-history-is-not-a-backup","rolling your code back does not bring a deleted table with it",[10,241,242],{},"That second kind of accident is what a backup answers. It sits behind you in\ntime, holding the state of your database at a moment you can name, so a mistake\nmade outside your workflow still has somewhere to go back to.",[10,244,245],{},"That is also what Reeve Care is: scheduled copies of your Supabase database, held\noutside your Supabase account, read back and checked before any of them counts\nas taken. Connect your Storage buckets and the files your users\nuploaded ride along, so a restore puts back the rows and the images those rows\npoint at.",[10,247,248],{},"Keep branching switched on either way. Nothing above is an argument for turning\nit off.",[25,250,252],{"id":251},"what-to-do-this-week","What to do this week",[254,255,256],"key-takeaways",{},[174,257,258,261,264,267,270],{},[177,259,260],{},"Find out what is copying your database on a schedule, separately from anything that branches it. If that takes more than a minute to establish, the answer is that nothing is.",[177,262,263],{},"If you have been treating a cloned branch as your safety net, note the date it was created and the date its pull request closes. Those are the two ends of what it covers.",[177,265,266],{},"Turn on whatever backup your Supabase plan includes. It is the cheapest thing on this list and it covers the ordinary disaster, which is that you broke your own data.",[177,268,269],{},"Keep one copy outside your Supabase account, because a branch and a platform backup are both behind the same login as the thing they protect.",[177,271,272],{},"Restore one copy into a throwaway project, so the first time you read that file is not the day you need it.",[10,274,275,276,280,281,130],{},"Before you close this tab, open your Supabase project and look at whether\nanything is taking a copy on a schedule. That one answer is the whole of today's\nwork, and branching does not change it either way. The\n",[126,277,279],{"href":278},"\u002Fchecklist","10-minute security checklist"," covers it alongside the rest of what\nis worth confirming on a newly launched app, and what a copy holds and what\npressing restore actually does is drawn out on the\n",[126,282,284],{"href":283},"\u002Fsupabase-backups","Supabase backups page",{"title":286,"searchDepth":287,"depth":287,"links":288},"",3,[289,291,292,293,294,295,296],{"id":27,"depth":290,"text":28},2,{"id":133,"depth":290,"text":134},{"id":146,"depth":290,"text":147},{"id":165,"depth":290,"text":166},{"id":201,"depth":290,"text":202},{"id":225,"depth":290,"text":226},{"id":251,"depth":290,"text":252},"Backups","\u002Fblog\u002Fsupabase-branching-is-not-a-backup\u002Fcover-1200x630.png","A line of data running on, with a second line splitting away from it and carrying an empty database alongside.","Supabase branching is not a backup: a branch starts with none of your data, and merging only moves schema. What it is for, and what to use instead.",false,"md",[304,306,309,312,315],{"q":28,"a":305},"No. A branch is a separate Supabase database built from your migrations, and Supabase documents that new branches start with none of the data from your main project. Branching gives you somewhere to test a change before it reaches production. A backup gives you a copy of your data from a moment you can name, so you can get back to it. Those are two different jobs and turning on the first does nothing about the second.",{"q":307,"a":308},"Does a Supabase preview branch have my production data in it?","Not by default. Supabase says new branches do not start with any data from your main project, and gives protecting your production data as the reason. You can opt into a clone when you create the branch, and the CLI documents that flag as cloning production data to the branch database. If you did not ask for it, your branch has your tables and none of your rows.",{"q":310,"a":311},"Can I restore my production database from a branch?","There is no restore in branching. Merging a branch applies its migrations to your production database and deploys your Edge Function changes; nothing in that path moves rows, and nothing in it reverses anything. If you cloned production data into a branch you could dump that database out and replay it yourself, but at that point the thing protecting you is the dump, not the branch.",{"q":313,"a":314},"What happens to my branch when I merge the pull request?","A preview branch is deleted. Supabase describes preview branches as ephemeral and says they are automatically deleted when a pull request is merged or closed. Persistent branches are the other kind, meant for staging or QA, and they are not removed when the pull request closes. So if a branch is holding the only copy of something you care about, the default setting throws it away on the day the work finishes.",{"q":316,"a":317},"Does branching cost extra?","Yes. Supabase lists branching on the paid plans and bills it per branch, per hour, on top of your subscription. Read the current rate on their pricing page rather than here, because it is theirs to change. The practical version: a persistent branch left running is a second Supabase project you are paying for every hour it exists.","\u002Fblog\u002Fsupabase-branching-is-not-a-backup\u002Fcard-800x500.png",[320,321,322,323,324,325],"supabase branching backup","is supabase branching a backup","supabase preview branch data","supabase branching vs backup","supabase branch production data","supabase database branching",{},true,"Supabase branching is not a backup","\u002Fblog\u002Fsupabase-branching-is-not-a-backup","2026-08-25",{"title":5,"description":300},"blog\u002Fsupabase-branching-is-not-a-backup",[334,335,336],"Supabase branching is not a backup. A branch is a second database for testing changes, and it starts with none of your production data in it.","Merging a branch applies your schema changes to production. It never carries rows, and there is no operation that puts an older version of your data back.","Even a branch you clone your data into sits inside the same account, and a preview branch is deleted when its pull request closes.","i-JUeTG72LNZcObndeGerHI6uzgNYmqH-1oVgpmU4Wg",1787826048204]