Hire Lovable Xperts
Migration

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.

What Lovable keeps for you, and what you have to keep yourself (Lovable and Supabase docs, read 18 Nov 2026)
Part of the appLovable's built-in copyRestore it fromYour own copy
CodeA version for every changeHistory 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 daysMore → Database → Manage → Backups: Restore to this backupDatabase export: a compressed PostgreSQL archive, or CSV for one table
User accounts and password hashesInside the daily database backupThe same database restoreInside the database export
Files in storageNot in the database backup or exportNothing to restore fromDownload from More → Storage
Edge Function codeNot in the database backup or exportYour code copyKeep it with your code in Git
Secrets, API keys, sign-in provider settingsNot in the database backup or exportNothing to restore fromYour 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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.

Lovable warns that a restore can remove accounts created after the backup and undo later password changes, and that scheduled jobs and email sending may not reliably come back. Anyone with edit access can restore, so agree who decides before the day you need it. If only a few rows are wrong, restoring the whole database also undoes every other user's changes since that backup.

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.

Check a Lovable database export without restoring it (replace the file name)
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.

  1. Storage: download the files from More → Storage and keep them with the database export.
  2. 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.
  3. Sign-in: note each provider you use (Google, GitHub and others), its client ID, and the redirect URLs it allows.
  4. Domains and webhooks: note the custom domain's DNS records and every webhook URL another service calls.

Related: Where secrets belong in a Lovable app

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's own CLI backup: roles, schema and data as three files
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 daily backups by plan (Supabase docs, read 18 Nov 2026)
Supabase planDaily backups keptPoint-in-time recovery
FreeNone named on Supabase's backup page; export with the CLINot listed for Free
Pro7 daysPaid add-on
Team14 daysPaid add-on
EnterpriseUp to 30 daysPaid 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 broke, and which copy to use first
What happenedUse firstWatch out for
A prompt broke the app; the data looks fineRevert in HistoryRevert restores code only; check the schema still matches
Rows were deleted or overwritten in the last two weeksLovable Cloud daily backupEverything after that backup is lost, for every user
Only a few rows in one table were damagedYour database export, restored into a scratch database to copy those rows backNeeds someone comfortable with SQL
The problem started more than two weeks agoYour own export or Git historyLovable keeps daily backups for about 14 days
The GitHub repository was deletedThe code still in LovableSync has stopped; reconnecting creates a new repository
The whole project is gone from LovableContact Lovable support quicklyThen 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?
Yes, for Lovable Cloud databases. Lovable takes one backup a day and keeps up to roughly 14 days of them, listed under More → Database → Manage → Backups. Restoring one replaces the whole database with that day's copy, and the backups don't include storage files, Edge Function code, secrets or sign-in settings.
Does reverting to an earlier version restore my data?
No. Lovable's version history restores your project's code only and does not roll back database data. Rows created or deleted after that version stay as they are. To get data back, use a database backup or your own export.
Does GitHub sync back up my Lovable database?
No. Git sync keeps your project's code in a repository; the database is backed up and exported separately. Lovable's backup docs also put storage files, secrets and sign-in settings outside the database backup, so a complete backup needs the code copy, a database export and a storage download.
Can I download Lovable's daily backups?
Lovable's backup page describes restoring a daily backup in place, not downloading it. The copy you can take away is the database export: a compressed PostgreSQL archive you load with pg_restore, limited to one request every 24 hours.
Is a Lovable database export safe to share?
Treat it as sensitive. Lovable's export includes user accounts and password hashes, so keep it encrypted and share it only with the person restoring it, never in a public repository or an open folder.
How do I check a Lovable backup actually works?
Run pg_restore --list on the export file: every table that has rows shows a TABLE DATA line and your RLS policies show as POLICY lines. For full proof, restore it into a scratch Postgres database and open the tables you rely on.

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.

Or hire a Lovable developer for the whole job →

Book a free audit call