[{"data":1,"prerenderedAt":541},["ShallowReactive",2],{"blog-en-how-to-restore-a-supabase-backup":3},{"id":4,"title":5,"body":6,"category":497,"cover":498,"coverAlt":499,"description":500,"draft":501,"extension":502,"faq":503,"image":521,"keywords":522,"meta":529,"navigation":530,"ogTitle":531,"path":532,"published":533,"seo":534,"stem":535,"tldr":536,"updated":533,"__hash__":540},"blog_en\u002Fblog\u002Fhow-to-restore-a-supabase-backup.md","How to restore a Supabase backup, and what breaks after",{"type":7,"value":8,"toc":485},"minimark",[9,13,16,19,24,27,87,90,99,103,106,116,119,122,125,133,137,140,150,153,156,159,163,169,175,178,188,194,212,215,219,222,228,303,306,310,313,318,357,361,397,410,414,417,420,426,432,438,444,447,458,466,477],[10,11,12],"p",{},"Something in your database is wrong, and for once you have a copy of it. Now\nyou are looking at a button you have never pressed, on a project with real\nusers in it, working out what it is about to do to them.",[10,14,15],{},"Here is the part that guide after guide leaves out. Almost every article on how\nto restore a Supabase backup stops at the moment the restore finishes, and that\nis where most of the trouble starts. The common outcome is not a restore that\nfails. It is one that succeeds and leaves the app broken anyway, because a\ndatabase backup only ever held the database.",[10,17,18],{},"It helps to stop picturing this as putting your data back. A restore swaps your\ndatabase for an older one, closer to exchanging a whole filing cabinet than to\nrefiling one folder. Everything below follows from that.",[20,21,23],"h2",{"id":22},"how-do-i-restore-a-supabase-backup","How do I restore a Supabase backup?",[10,25,26],{},"Three routes, and which of them is open to you today was decided before today.",[28,29,30,46],"table",{},[31,32,33],"thead",{},[34,35,36,40,43],"tr",{},[37,38,39],"th",{},"Route",[37,41,42],{},"What it does",[37,44,45],{},"What it needs",[47,48,49,61,72],"tbody",{},[34,50,51,55,58],{},[52,53,54],"td",{},"The Supabase dashboard",[52,56,57],{},"Replaces the database in that project with a dated nightly copy you pick",[52,59,60],{},"A paid plan, and the copy still sitting inside your window",[34,62,63,66,69],{},[52,64,65],{},"Point-in-time recovery",[52,67,68],{},"Rewinds the whole project to a minute you name",[52,70,71],{},"The PITR add-on, bought before the thing you are recovering from",[34,73,74,81,84],{},[52,75,76,77],{},"A dump file, replayed with ",[78,79,80],"code",{},"psql",[52,82,83],{},"Loads the file into whichever project you point it at, new ones included",[52,85,86],{},"The file, and the database password for the target project",[10,88,89],{},"The first two put your data back where it already was. The third is the only\none that can put it somewhere else, which is what you need on the day the\nproblem is your account rather than your data.",[10,91,92,93,98],{},"If you are not sure which of these you have,\n",[94,95,97],"a",{"href":96},"\u002Fblog\u002Fdoes-supabase-back-up-my-database","which Supabase plan you are on settles the first two","\nand takes about two minutes to check.",[20,100,102],{"id":101},"copy-what-you-have-now-before-you-restore-anything","Copy what you have now, before you restore anything",[10,104,105],{},"Take a copy of the database in its current broken state first. It is one\ncommand, and it is what makes every decision after it reversible.",[107,108,113],"pre",{"className":109,"code":111,"language":112},[110],"language-text","pg_dump \"postgresql:\u002F\u002F…your connection string…\" \\\n  --clean --if-exists --no-owner \\\n  --file before-restore-2026-08-24.sql\n","text",[78,114,111],{"__ignoreMap":115},"",[10,117,118],{},"There are two reasons, and people usually learn the second one afterwards.",[10,120,121],{},"The first is that a restore is a replacement. The tables in the copy come back\nexactly as they were, so every row written to them since goes too. A customer\nwho signed up this morning is a row you are about to delete on purpose.",[10,123,124],{},"The second is that your broken database is still the only place some of your\ndata exists. If the copy is from Tuesday and the damage happened on Thursday,\neverything created on Wednesday is sitting in front of you right now and\nnowhere else. Restore over it and it goes a second time, by your hand rather\nthan by the accident.",[10,126,127,128,132],{},"While you work, turn off anything that writes new rows.\n",[94,129,131],{"href":130},"\u002Fblog\u002Fai-agent-deleted-my-database","The reasoning is the same as after any bad delete",":\nthe gap between the copy and now gets more expensive the longer the app keeps\nfilling it.",[20,134,136],{"id":135},"restoring-from-the-supabase-dashboard","Restoring from the Supabase dashboard",[10,138,139],{},"This replaces the database in your project with the copy you choose, and the\nproject is unavailable while it runs.",[10,141,142,143,149],{},"Open the project your app talks to, find Database and then Backups, and pick\nthe dated copy you want. Read the exact steps in\n",[94,144,148],{"href":145,"rel":146},"https:\u002F\u002Fsupabase.com\u002Fdocs\u002Fguides\u002Fplatform\u002Fbackups",[147],"nofollow","Supabase's own backup documentation",",\nbecause the dashboard gets rearranged and this page will not notice when it\ndoes.",[10,151,152],{},"How long it takes depends on the size of your database, which is Supabase's own\nanswer. Put up a maintenance notice before you begin.",[10,154,155],{},"Point-in-time recovery is the same operation with a finer dial. Instead of\npicking last night you name a minute, and the project rewinds to it. Supabase\ndescribes it as destructive, which is the right word for it. Their\ntroubleshooting notes also say a point-in-time restore cannot start until\nexisting replication slots and subscriptions are removed, so if anything in\nyour app streams database changes as they happen, that is a step to take first\nrather than an error to hit halfway through.",[10,157,158],{},"Neither route can put your data into a different project. Both act on the\nproject you are standing in, which means both are unavailable on the day the\nthing that went wrong is your access to the account.",[20,160,162],{"id":161},"restoring-a-dump-file-with-psql","Restoring a dump file with psql",[10,164,165,166,168],{},"You point ",[78,167,80],{}," at a project and replay the file into it. That project can be\nthe one you had, or a brand new one on an account you opened this morning.",[107,170,173],{"className":171,"code":172,"language":112},[110],"psql -d \"postgresql:\u002F\u002F…the target project's connection string…\" \\\n  --variable ON_ERROR_STOP=1 \\\n  --single-transaction \\\n  --file backup-2026-08-09.sql\n",[78,174,172],{"__ignoreMap":115},[10,176,177],{},"Two of those flags are worth understanding, because psql's default behaviour is\nthe surprising one.",[10,179,180,183,184,187],{},[78,181,182],{},"ON_ERROR_STOP=1"," stops at the first error. Leave it out and psql reads the\nerror, prints it, and carries on to the next line, so a file that failed on\nline 400 of 30,000 still ends at a prompt that looks like success, over a\ndatabase missing everything after that line. ",[78,185,186],{},"--single-transaction"," wraps the\nwhole file in one operation, so a failure leaves the database as it was instead\nof half changed.",[10,189,190,191,193],{},"Then the credential, which is where people get stuck. Replaying a backup means\nwriting, so it needs something that can write. An anon key will not do it and\nneither will a read-only one. What ",[78,192,80],{}," wants is the database password for\nthe target project, which lives in your Supabase project settings under\nDatabase.",[10,195,196,197,201,202,205,206,211],{},"What comes back depends on what is in the file, and that was settled when the\ndump was taken. Your ",[198,199,200],"strong",{},"login accounts"," are the part to check before you rely\non it. They live in a schema called ",[78,203,204],{},"auth"," alongside the hashed passwords, and\nSupabase documents\n",[94,207,210],{"href":208,"rel":209},"https:\u002F\u002Fsupabase.com\u002Fdocs\u002Fguides\u002Ftroubleshooting\u002Fmigrating-auth-users-between-projects",[147],"moving them between projects","\nas a job with its own steps. If you are restoring into a new project and you\nwant people to sign in with the password they already have, read that page\nbefore you start.",[10,213,214],{},"And a new project has a new URL and new keys. Your app is still pointed at the\nold one until you change it, which is the first line of the next section.",[20,216,218],{"id":217},"it-restored-and-the-app-is-still-broken","It restored, and the app is still broken",[10,220,221],{},"This is the ordinary outcome. It is almost always one of five things, and the\nfirst one takes a minute.",[223,224],"diagram",{"alt":225,"caption":226,"src":227},"A saved copy feeding into a Supabase project drawn as three stacked blocks. The public block is solid and full of rows and ticked. The auth block carries a tick and a cross together. The storage block is dashed, empty and crossed.","A restore lands on the schema your tables live in. Your uploaded files sit outside it and were never in the copy, and whether your login accounts come back depends on how that copy was taken.","\u002Fblog\u002Fhow-to-restore-a-supabase-backup\u002Fhow-far-the-restore-reached-1600x620.png",[28,229,230,243],{},[31,231,232],{},[34,233,234,237,240],{},[37,235,236],{},"What you see",[37,238,239],{},"What actually happened",[37,241,242],{},"What to do",[47,244,245,256,267,281,292],{},[34,246,247,250,253],{},[52,248,249],{},"The app loads and every list is empty",[52,251,252],{},"It is still talking to the old project",[52,254,255],{},"Put the new project's URL and publishable key into your app's settings, then redeploy",[34,257,258,261,264],{},[52,259,260],{},"Images, avatars and uploads are gone",[52,262,263],{},"Files live in Storage, outside the database. The rows you restored hold only the path to each file",[52,265,266],{},"Restore your files from their own copy. No database backup on any route contains them",[34,268,269,272,278],{},[52,270,271],{},"Nobody can sign in",[52,273,274,275,277],{},"Login accounts live in the ",[78,276,204],{}," schema, and whether they were in the file depends on how the dump was taken",[52,279,280],{},"Follow Supabase's auth migration guide, or restore again from a copy that includes that schema",[34,282,283,286,289],{},[52,284,285],{},"Pages read fine and saving anything fails",[52,287,288],{},"The database came back readable and not writable",[52,290,291],{},"Create a row through the app before you call it done. The paragraph below has the detail",[34,293,294,297,300],{},[52,295,296],{},"One feature is broken, its table is fine",[52,298,299],{},"Edge functions live in your repository, outside the database",[52,301,302],{},"Redeploy them from your builder or your repo",[10,304,305],{},"The fourth one deserves the attention. Permission to read and permission to\nwrite are granted separately, and a restore can land one and miss the other. So\nthe pages fill with your data, everything looks recovered, and then the first\nperson to submit a form gets an error. Looking at the app will never show you\nthis, because looking is reading.",[20,307,309],{"id":308},"how-to-tell-whether-the-restore-actually-worked","How to tell whether the restore actually worked",[10,311,312],{},"Sign in, find a row you can name, and then write one. In that order, and the\nlast one is the check that counts.",[223,314],{"alt":315,"caption":316,"src":317},"Two lanes into the same restored database. The upper lane, labelled select, returns a row and carries a tick. The lower lane, labelled insert, stops at the edge of the database and carries a cross.","Both go to the same restored database, and the rows are visibly there in both. Only the second one finds out whether the restore finished.","\u002Fblog\u002Fhow-to-restore-a-supabase-backup\u002Fread-passes-write-fails-1600x620.png",[319,320,321,328,334,340,346],"ul",{},[322,323,324,327],"li",{},[198,325,326],{},"Sign in through the app the way a user would",", rather than opening the\nSupabase table editor. That tests the app, the connection and the login\naccounts in one go.",[322,329,330,333],{},[198,331,332],{},"Find a row you remember."," A specific order, a named customer, the last\nthing you added before it broke. \"The data looks like it is there\" is a\nfeeling; a row you can name is a check.",[322,335,336,339],{},[198,337,338],{},"Compare a count against what you expected."," Open your biggest table in the\nSupabase editor and read the number of rows. A restore that stopped partway\nusually shows up here as a number that is too small.",[322,341,342,345],{},[198,343,344],{},"Then write something."," Create a row the way a user does: place a test\norder, save a profile, post a comment. This is the check that fails when the\nother three pass, and it is the only thing that proves the restore finished.",[322,347,348,351,352,356],{},[198,349,350],{},"Open something a user uploaded."," If your app has images or attachments,\nclick one.\n",[94,353,355],{"href":354},"\u002Fblog\u002Fsupabase-storage-bucket-public","Whether your files came back is a separate question from whether your rows did",".",[20,358,360],{"id":359},"what-to-do-right-now","What to do right now",[362,363,364],"key-takeaways",{},[319,365,366,373,376,382,391,394],{},[322,367,368,369,372],{},"Copy the database as it is now, before you restore anything. It is one ",[78,370,371],{},"pg_dump",", and it is what makes the next decision reversible.",[322,374,375],{},"Turn off anything that writes new rows while you work, because a restore deletes whatever arrived after the copy was taken.",[322,377,378,379,381],{},"Match the route to the problem. A dashboard restore fixes your data; only a dump file replayed with ",[78,380,80],{}," can move your data to a new project.",[322,383,384,385,387,388,390],{},"If you are using ",[78,386,80],{},", set ",[78,389,182],{},". A restore that quietly gave up partway looks exactly like one that worked.",[322,392,393],{},"Check the restore by writing, not by reading. Sign in, find a row you can name, then create one through the app.",[322,395,396],{},"Treat your uploaded files and your login accounts as separate jobs. Neither is finished when the database restore is.",[10,398,399,400,404,405,409],{},"Before you close this tab, find out whether you have anything to restore from\nat all, and where it is. That one answer decides which half of this article you\nwill ever need. The ",[94,401,403],{"href":402},"\u002Fchecklist","10-minute security checklist"," covers it\nalongside the other things worth confirming on a newly launched app, and the\n",[94,406,408],{"href":407},"\u002Fis-your-supabase-app-safe","Supabase safety guide"," goes through what tends to\nbe left open.",[20,411,413],{"id":412},"what-reeve-care-does-on-the-day-you-restore","What Reeve Care does on the day you restore",[10,415,416],{},"The copy already exists, it has already been read back and checked, and it sits\noutside your Supabase account. That turns the hour above into a choice of which\ncopy, and a button.",[10,418,419],{},"Four things it changes about this article specifically.",[10,421,422,425],{},[198,423,424],{},"The copy has been verified before you need it."," Every backup is read back\nand counted against what went in, and the date shown in your dashboard is the\nlast copy that passed rather than the last one attempted. The half-finished\nrestore this article warns about is a problem we find on an ordinary afternoon,\nbefore it is yours.",[10,427,428,431],{},[198,429,430],{},"The safety copy is not a step you have to remember."," Pressing restore takes\na fresh copy of the current state first, so the restore itself can be undone.",[10,433,434,437],{},[198,435,436],{},"Your uploaded files come back too",", once you connect your Storage buckets.\nThat is the row in the table above with no good answer otherwise.",[10,439,440,443],{},[198,441,442],{},"The database key we hold can only read."," A restore has to write, so it asks\nfor your database password each time and keeps none of it. The optional key for\nyour files can write, because Supabase issues no read-only key for Storage, and\nthe page where you hand it over says so before you do.",[10,445,446],{},"The limits belong in the same breath, because you should know them before you\npay rather than during an outage:",[319,448,449,452,455],{},[322,450,451],{},"It works with Supabase and nothing else today.",[322,453,454],{},"You restore to a copy that exists, not to any minute you name. Worst case you lose one interval, which is up to a night on the entry plan and shorter on the two above it.",[322,456,457],{},"Login accounts are never touched. Nobody is signed out, deleted, or brought back.",[10,459,460,461,465],{},"Keep your Supabase backups switched on either way. Two copies in two places is\nthe whole idea, and the cheaper of the two is already in your plan.\n",[94,462,464],{"href":463},"\u002F#pricing","What each Care plan covers"," is on the homepage.",[10,467,468,469,471,472,476],{},"If you would rather not pay for any of it, everything in this article still\nworks. A ",[78,470,371],{}," on a schedule you genuinely keep, held somewhere that losing\nyour Supabase account would not also take, plus one practice restore a quarter,\ngets you most of the way there.\n",[94,473,475],{"href":474},"\u002Fblog\u002Fthree-ways-to-back-up-a-supabase-database","The three routes and what each one misses","\ncovers that without a sales pitch.",[10,478,479,480,484],{},"The whole cycle is drawn out step by step on the\n",[94,481,483],{"href":482},"\u002Fsupabase-backups","Supabase backups page",": the copy leaving Supabase, the\ncheck that follows it, and the button that puts it back.",{"title":115,"searchDepth":486,"depth":486,"links":487},3,[488,490,491,492,493,494,495,496],{"id":22,"depth":489,"text":23},2,{"id":101,"depth":489,"text":102},{"id":135,"depth":489,"text":136},{"id":161,"depth":489,"text":162},{"id":217,"depth":489,"text":218},{"id":308,"depth":489,"text":309},{"id":359,"depth":489,"text":360},{"id":412,"depth":489,"text":413},"Backups","\u002Fblog\u002Fhow-to-restore-a-supabase-backup\u002Fcover-1200x630.png","A saved copy opening into a database, its rows arriving one after another and filling the empty space below them.","How to restore a Supabase backup from the dashboard or from a dump file, what the restore replaces, and why your app can still be broken when it finishes.",false,"md",[504,506,509,512,515,518],{"q":23,"a":505},"There are three routes. From the dashboard you pick a dated nightly copy and Supabase replaces that project database with it, which needs a paid plan. Point-in-time recovery rewinds the whole project to a minute you name, which needs the PITR add-on bought in advance. Or you replay a dump file into a project yourself with psql, which is the only route that can put your data into a different project on a different account. Before any of them, take a copy of the database as it is now.",{"q":507,"a":508},"Does restoring a backup delete the data added since it was taken?","Yes. A restore is a replacement rather than a merge: the tables in the copy come back exactly as they were at that moment, and everything written to them afterwards goes. That includes rows that were perfectly fine. It is the reason to stop your app writing before you start, and the reason to keep a copy of the current state so you can put the good newer rows back on top afterwards if you decide you want them.",{"q":510,"a":511},"My restore finished but the images in my app are missing. Why?","Because your files were never in the backup. Supabase Storage sits outside your Postgres database, so a database backup holds the row that points at each file and none of the files themselves. Restoring gives you a table full of links to things that are no longer there, or that are in a project you are no longer using. Storage has to be copied and restored separately, whichever backup route you took.",{"q":513,"a":514},"Can I restore a Supabase backup into a different project?","Only with a dump file you hold. The dashboard restore and point-in-time recovery both act on the project you are standing in, so neither helps on the day the problem is that you cannot get into the account at all. A pg_dump file replayed with psql goes into whichever project you point it at, including a brand new one on a new account. That is the difference the day it matters.",{"q":516,"a":517},"Will my users have to sign up again after a restore?","That depends on whether your login accounts were in the copy. They live in a database schema called auth, along with the hashed passwords, and Supabase documents moving them between projects as a job with its own steps rather than as something that rides along with your tables. If you are restoring into a new project, read that guide before you start. A restore inside the same project usually leaves sign-in alone.",{"q":519,"a":520},"How long does a Supabase restore take?","Supabase says it depends on the size of your database and how much data has to be processed, which is the honest answer and not a helpful one when you are waiting. Assume the project is unavailable for the duration and put up a maintenance notice before you begin. Their troubleshooting notes also say a point-in-time restore cannot start until existing replication slots and subscriptions are removed, so check that first if anything in your app streams database changes.","\u002Fblog\u002Fhow-to-restore-a-supabase-backup\u002Fcard-800x500.png",[523,524,525,526,527,528],"restore supabase backup","how to restore supabase backup","supabase point in time recovery","restore pg_dump with psql","restore supabase database to a new project","supabase restore auth users",{},true,"How to restore a Supabase backup","\u002Fblog\u002Fhow-to-restore-a-supabase-backup","2026-08-24",{"title":5,"description":500},"blog\u002Fhow-to-restore-a-supabase-backup",[537,538,539],"To restore a Supabase backup you either roll the project back from the dashboard, or replay a dump file into a project with psql. Which one is open to you was decided before today.","Copy the database as it is now before you restore anything. A restore replaces the tables in the copy, so every row written since goes with them.","The common outcome is a restore that succeeds and an app that is still broken, because your uploaded files and your login accounts were never in the database copy.","anM7tAiRlJtdd4DrMhtANVSkicOB87U5Oke5ZzW7O1Y",1787826048204]