How to Back Up a Lovable App: Code, Database and Files
A Lovable app has four things to back up, and no single button covers them all. Version history keeps every change to your code. Lovable backs up the database once a day and keeps about 14 days. Storage files, secrets and sign-in settings sit outside both. For a copy you control, sync the code to GitHub, export the database, and download your files.
By Hire Lovable Xperts · Last verified: 2026-11-18
Does Lovable back up your app automatically?
Partly. Every change Lovable makes creates a version you can revert to, and Lovable backs up your project's database every day, keeping up to roughly 14 days. Those two cover code and database rows. Neither covers files in storage, secrets, sign-in provider settings or API keys, and neither is a copy outside Lovable. The table shows each part of the app and where its copy lives.
| Part of the app | Lovable's built-in copy | Restore it from | Your own copy |
|---|---|---|---|
| Code | A version for every change | History panel: Revert (code only, never data) | Git sync to GitHub, GitLab or Bitbucket (any plan) or Download codebase .zip (paid plans) |
| Database tables and rows (Lovable Cloud) | One backup a day, up to roughly 14 days | More → Database → Manage → Backups: Restore to this backup | Database export: a compressed PostgreSQL archive, or CSV for one table |
| User accounts and password hashes | Inside the daily database backup | The same database restore | Inside the database export |
| Files in storage | Not in the database backup or export | Nothing to restore from | Download from More → Storage |
| Edge Function code | Not in the database backup or export | Your code copy | Keep it with your code in Git |
| Secrets, API keys, sign-in provider settings | Not in the database backup or export | Nothing to restore from | Your own record of each one, kept somewhere private |
How do you back up a Lovable app's code?
Connect Git sync. It works on any plan, keeps a repository in step with the project in both directions, and leaves you a full copy outside Lovable. On paid plans you can also download the whole project as a .zip with Download codebase. Version history alone is not a backup you hold: it lives inside the project, and very old versions can be previewed but no longer restored.
- In Lovable, open the project and connect Git sync (GitHub, GitLab or Bitbucket). Lovable creates a new repository; it can't attach one you already have.
- Leave the repository in place. Deleting it on GitHub stops the sync; disconnecting the project instead keeps the repository on GitHub with all its history.
- On a paid plan, also download a .zip with Download codebase (Project settings → Git, or the button under the code editor's file list) before any big change.
- In History, bookmark the versions you know work, such as a release, so the right restore point is easy to find later.
Related: Export Lovable code to GitHub · Lovable GitHub repo deleted: what still works
How do you restore a Lovable Cloud database backup?
Open More → Database, then Manage, then Backups. The daily backups are listed with their times in UTC. Pick one, click Restore to this backup and confirm. The database is unavailable for a few minutes while it restores. The restore can't be undone: anything created or changed after that backup is gone, and the schema goes back too, so code written since may need fixing.
Reverting a version in History is not the same thing. Lovable's history docs say reverting restores your project's code only and does not roll back database data, so a revert after a bad schema change leaves code and database out of step. Our Lovable 2.0 rollback guide covers that mismatch.
How do you export a full copy of a Lovable database?
Open More → Database, then Manage, then Settings, and request an export. Lovable emails you when it's ready and saves the file to storage. It's a compressed PostgreSQL archive that loads into a new database with pg_restore, and it includes user accounts and password hashes. Limits: databases up to 15 GB, files up to 5 GB, one export every 24 hours, and the database must be running.
pg_restore --list lovable-export-file | grep -E "TABLE DATA|POLICY"Treat the file like a password list: it holds every user's account and password hash. Store it encrypted, outside the shared drive the whole team can open.
You can check the file is a real, readable copy without restoring it anywhere. pg_restore --list prints the archive's table of contents: every table with rows has a TABLE DATA line, and your RLS policies appear as POLICY lines. A table you expect that has no TABLE DATA line is missing from the copy.
For a single table, the Database view also downloads CSV, which is handy for a quick look in a spreadsheet but is not a backup of the whole app.
How do you back up storage files, secrets and sign-in settings?
By hand, because no Lovable backup or export includes them. Download your files from More → Storage. For secrets, API keys and sign-in providers, keep a private record of each one: its name, which service issued it, and where to get a new value. You can't recreate a secret from a backup, but with that record you can reissue it in minutes.
- Storage: download the files from More → Storage and keep them with the database export.
- Secrets: list every secret name your Edge Functions read, with the dashboard that issues it (Stripe, Resend, OpenAI and so on). Keep the values in a password manager, never in the repository.
- Sign-in: note each provider you use (Google, GitHub and others), its client ID, and the redirect URLs it allows.
- Domains and webhooks: note the custom domain's DNS records and every webhook URL another service calls.
What if your Lovable app uses its own Supabase project?
Then the database lives in your Supabase account and Supabase's rules apply, not Lovable Cloud's. Supabase backs up Pro, Team and Enterprise projects daily, keeping 7, 14 and up to 30 days. Its backup page names no daily backups for Free projects and recommends exporting with the CLI. Supabase backups don't include Storage files either, so download those separately.
supabase db dump --remote=[CONNECTION_STRING] -f roles.sql --role-only
supabase db dump --remote=[CONNECTION_STRING] -f schema.sql
supabase db dump --remote=[CONNECTION_STRING] -f data.sql --use-copy --data-only -x "storage.buckets_vectors" -x "storage.vector_indexes"Supabase notes that changes you made to its own auth and storage schemas, such as triggers or RLS policies, have to be restored separately. If you are moving to your own Supabase project for exactly this kind of control, our guide to moving to your own Supabase covers the order.
| Supabase plan | Daily backups kept | Point-in-time recovery |
|---|---|---|
| Free | None named on Supabase's backup page; export with the CLI | Not listed for Free |
| Pro | 7 days | Paid add-on |
| Team | 14 days | Paid add-on |
| Enterprise | Up to 30 days | Paid add-on |
Which copy do you restore when something goes wrong?
Match the copy to what broke, and use the smallest restore that fixes it. A prompt that broke the screens needs a code revert, not a database restore. Lost or damaged rows need the database backup or your export. A deleted repository or project needs a different route again. The table pairs the common problems with the copy to reach for first.
| What happened | Use first | Watch out for |
|---|---|---|
| A prompt broke the app; the data looks fine | Revert in History | Revert restores code only; check the schema still matches |
| Rows were deleted or overwritten in the last two weeks | Lovable Cloud daily backup | Everything after that backup is lost, for every user |
| Only a few rows in one table were damaged | Your database export, restored into a scratch database to copy those rows back | Needs someone comfortable with SQL |
| The problem started more than two weeks ago | Your own export or Git history | Lovable keeps daily backups for about 14 days |
| The GitHub repository was deleted | The code still in Lovable | Sync has stopped; reconnecting creates a new repository |
| The whole project is gone from Lovable | Contact Lovable support quickly | Then rebuild from your Git copy and export |
Related: Recover a lost Lovable project · What breaks when you export a Lovable app
How often should you back up a Lovable app?
Keep Git sync connected all the time, and take a database export and a storage download before every risky change: a schema change, a big prompt, a Lovable platform upgrade or a move to another host. Lovable's daily backups only reach back about 14 days, so if a problem might go unnoticed for longer, a regular export of your own is the only older copy.
A simple routine for a live app with users: Git sync always on; a database export and storage download once a week (the export allows one request per 24 hours); and the secrets record updated whenever a key changes. Open the newest export with pg_restore --list now and then, so you find out the copy is incomplete on a quiet day rather than during an outage.
When is it worth getting help with backups?
When the app has paying users, payments or roles, a backup is only as good as the restore you have tested. Lovable's tools give you the pieces; putting them together into a copy you own, and proving it restores, is a migration-sized job. If you'd rather own the database outright, moving it to your own Supabase project puts its backups under your control.
Our Lovable migration service moves managed data to your own Supabase, including schema, RLS, triggers, storage and auth users, after a pre-flight audit of env vars, secrets, storage, auth and RLS, and finishes with post-migration verification of sign-in, payments, logs and a rollback path. It's quoted after a free scoping call. If the app is staying on Lovable and you mainly want someone watching it, the Lovable app maintenance and care plan covers uptime and error monitoring and security re-checks after changes.
Frequently asked questions
Does Lovable back up my database automatically?
Does reverting to an earlier version restore my data?
Does GitHub sync back up my Lovable database?
Can I download Lovable's daily backups?
Is a Lovable database export safe to share?
How do I check a Lovable backup actually works?
Sources
- Lovable Docs — back up, restore, and export your project's database
- Lovable Docs — revert and restore your project with version history
- Lovable Docs — FAQ (Download codebase on paid plans, Git sync on any plan, ownership)
- Lovable Docs — sync your Lovable project with GitHub
- Supabase Docs — database backups (plans, retention, Storage objects)
- Supabase Docs — backup and restore using the CLI
- PostgreSQL Docs — pg_restore (--list)
Talk to a senior engineer — not a salesperson.
Book a free 30-minute audit call. We'll diagnose what's wrong and tell you exactly what it costs to fix.