Skip to main content
RapidDev - Software Development Agency
lovable-issues

How to Back Up and Restore Lovable Project Data Safely

Lovable has built-in version history that lets you restore any previous state of your project. For external backups, connect GitHub to automatically sync your code to a repository. Download a full project ZIP via Dev Mode for local copies. Database backups require exporting data from Supabase separately — code backups do not include database contents.

Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate9 min read~10 minAll Lovable versions (Dev Mode/ZIP download requires Pro plan)March 2026RapidDev Engineering Team
TL;DR

Lovable has built-in version history that lets you restore any previous state of your project. For external backups, connect GitHub to automatically sync your code to a repository. Download a full project ZIP via Dev Mode for local copies. Database backups require exporting data from Supabase separately — code backups do not include database contents.

Why you need a backup strategy for Lovable projects

Lovable saves every version of your project automatically through its built-in version history. Each time the AI makes changes or you save edits in Dev Mode, a new version is created that you can preview and restore at any time. However, version history alone is not a complete backup strategy. If your Lovable account has issues, or if you want to move your project to a different platform, you need an external copy of your code. Connecting GitHub gives you a full repository backup that syncs automatically — every change in Lovable pushes to GitHub, and every change in GitHub syncs back. Database content is stored separately in Supabase (either Lovable Cloud or your own Supabase project). Code backups do not include database tables, user accounts, or stored files. If your app stores important data, you also need a database backup strategy through Supabase's built-in tools. The Lovable Cloud-managed Supabase instance has an important limitation: it is not visible in the Supabase Dashboard, so you cannot use the standard Supabase backup tools directly. For full data ownership, connecting your own Supabase project from the start gives you direct access to database management.

  • Relying only on Lovable version history without an external backup
  • No GitHub connection — code exists only inside Lovable's platform
  • Database data not backed up — code backups do not include Supabase tables or storage
  • AI looping problem corrupting project state — no clean version to revert to
  • Lovable Cloud vendor lock-in — managed Supabase not accessible from the standard dashboard

Error messages you might see

Restore previous versions greyed out

The restore button may appear inactive if the version is the current version or if the project has unsaved pending changes. Wait for any in-progress AI tasks to complete, then try again. If the button remains greyed out, try refreshing the page.

GitHub connected projects are currently experiencing issues

This is a Lovable platform status issue. Check status.lovable.dev for current incidents. Your code is still saved in Lovable — once sync resumes, your GitHub repository will update.

Error: this exceeds GitHub's file size limit of 100.00 MB

A file in your project is too large for GitHub. Large binary files (videos, datasets) must be removed from the repo or stored in Supabase Storage instead. Use GitHub LFS for files you must keep in the repository.

Before you start

  • A Lovable project open in the editor
  • A GitHub account if using GitHub backup (free accounts work)
  • Dev Mode access (Pro plan) if downloading ZIP backups
  • Access to Supabase dashboard if backing up database data

How to fix it

1

Use Lovable version history to restore a previous state

Version history is built-in and immediate — it is the fastest way to undo breaking changes

Scroll up in the chat panel to see all previous versions of your project, or click the View History icon. Each entry shows what changed (AI actions, manual edits). Click on any version to preview how your app looked at that point. When you find the version you want to restore, click Restore. This reverts your entire project to that exact state. The current (broken) version is not deleted — you can still access it in the version history afterward. Before making risky changes, note your current version so you can find it easily if you need to revert.

Expected result: Your project reverts to the selected previous version. All code and configuration return to that state.

2

Connect GitHub for automatic code backup

GitHub stores a complete copy of your code in a repository you own and control

Go to Settings → Connectors → GitHub → Connect GitHub (this connects your GitHub account via OAuth). Then click Connect project, choose your GitHub organization or personal account, and click Transfer anyway. Lovable creates a new repository and syncs your code. From this point, every change in Lovable automatically pushes to GitHub. This gives you a complete backup you can clone, fork, or deploy anywhere. If you ever leave Lovable, your code is safely on GitHub. Never rename or delete the repository after connecting — this permanently breaks sync.

Expected result: A GitHub repository with your complete project code, automatically syncing with every change.

3

Download a full project ZIP via Dev Mode

A ZIP download gives you a complete local copy independent of both Lovable and GitHub

Click the + button next to Preview to open Dev Mode (available on paid plans). In the file tree, look for the download option to download the entire project as a ZIP file. This ZIP contains all source files, configuration, and public assets. Store it in a safe location (cloud drive, local backup). This is especially useful before major refactors or when you want a snapshot at a specific milestone. The ZIP does not include node_modules (you would run npm install to regenerate those) or database data.

Expected result: A ZIP file on your computer containing all project source files, ready to run with npm install and npm run dev.

4

Back up your Supabase database data

Code backups do not include database tables, user accounts, or stored files — these need separate backup

If your app stores important data in Supabase, you need to back up the database separately. For self-hosted Supabase projects: go to the Supabase Dashboard → Project Settings → Database and use the built-in backup feature. For Lovable Cloud-managed Supabase: you cannot access the standard dashboard directly. Instead, create a data export by writing a query in your Lovable project that fetches all records and outputs them as JSON, or prompt Lovable to create an admin page with data export functionality. If setting up comprehensive database backup automation requires changes across multiple components, RapidDev's engineers have implemented this exact backup pattern across 600+ Lovable projects.

typescript
1// Simple data export utility for Lovable Cloud projects
2import { supabase } from '@/integrations/supabase/client';
3
4export async function exportTableData(tableName: string) {
5 const { data, error } = await supabase
6 .from(tableName)
7 .select('*');
8
9 if (error) throw error;
10
11 // Download as JSON file
12 const blob = new Blob(
13 [JSON.stringify(data, null, 2)],
14 { type: 'application/json' }
15 );
16 const url = URL.createObjectURL(blob);
17 const link = document.createElement('a');
18 link.href = url;
19 link.download = `${tableName}-backup-${new Date().toISOString().split('T')[0]}.json`;
20 link.click();
21 URL.revokeObjectURL(url);
22}

Expected result: A JSON file downloaded to your computer containing all records from the specified database table.

Complete code example

src/components/DataBackup.tsx
1import { useState } from 'react';
2import { supabase } from '@/integrations/supabase/client';
3import { Button } from '@/components/ui/button';
4import { Download } from 'lucide-react';
5
6// Admin component for exporting database data as JSON
7// Add this to an admin page for manual data backups
8export function DataBackup({ tables }: { tables: string[] }) {
9 const [exporting, setExporting] = useState<string | null>(null);
10
11 async function exportTable(tableName: string) {
12 setExporting(tableName);
13 try {
14 const { data, error } = await supabase
15 .from(tableName)
16 .select('*');
17
18 if (error) throw error;
19
20 const blob = new Blob(
21 [JSON.stringify(data, null, 2)],
22 { type: 'application/json' }
23 );
24 const url = URL.createObjectURL(blob);
25 const link = document.createElement('a');
26 link.href = url;
27 link.download = `${tableName}-${new Date().toISOString().split('T')[0]}.json`;
28 link.click();
29 URL.revokeObjectURL(url);
30 } catch (err) {
31 console.error(`Failed to export ${tableName}:`, err);
32 } finally {
33 setExporting(null);
34 }
35 }
36
37 return (
38 <div className="space-y-3">
39 <h3 className="text-lg font-semibold">Data Backup</h3>
40 {tables.map((table) => (
41 <Button
42 key={table}
43 variant="outline"
44 onClick={() => exportTable(table)}
45 disabled={exporting === table}
46 className="w-full justify-start"
47 >
48 <Download className="h-4 w-4 mr-2" />
49 {exporting === table ? `Exporting ${table}...` : `Export ${table}`}
50 </Button>
51 ))}
52 </div>
53 );
54}

Best practices to prevent this

  • Connect GitHub immediately on any serious project — it is the most reliable backup and enables external deployment
  • Before major refactors, note your current version in the chat or take a ZIP snapshot as a safety net
  • Never rename, move, or delete a connected GitHub repository — this permanently breaks the sync with Lovable
  • Back up database data separately from code — Supabase tables and storage are not included in GitHub or ZIP exports
  • Duplicate your project before experimental changes — this creates an independent copy you can safely experiment on
  • For Lovable Cloud projects, create an admin-only data export page so you can download database records on demand
  • Test restoring from a backup periodically — make sure your GitHub repo builds correctly with npm install and npm run dev

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I have a Lovable (lovable.dev) project and I need help creating a backup strategy. My project details: - Connected to GitHub: [yes/no] - Uses Lovable Cloud Supabase: [yes/no, or self-hosted Supabase] - Important database tables: [list your main tables] - Supabase Storage buckets: [list any storage buckets] Please: 1. Create a comprehensive backup checklist covering code, database, and files 2. Show me how to create a data export component for my database tables 3. Explain how to restore from each type of backup 4. Recommend a backup schedule for a production app 5. Tell me what I need to do differently with Lovable Cloud vs self-hosted Supabase

Lovable Prompt

Create an admin-only data backup page at /admin/backup. This page should list all my database tables and provide a button next to each one that exports the table data as a JSON file download. Use the supabase client to fetch all records with .select('*'). Each download should be named with the table name and today's date. Add a heading and brief instructions explaining that this exports data for backup purposes. Protect this page so only authenticated admin users can access it.

Frequently asked questions

How do I restore a previous version of my Lovable project?

Scroll up in the chat panel or click the View History icon to access version history. Click on any previous version to preview it. When you find the version you want, click Restore. Your project reverts to that state, but the version you replaced is still accessible in history.

Why is the Restore button greyed out in Lovable?

The Restore button may be inactive if an AI task is currently running, if the version is already the current state, or due to a temporary platform issue. Wait for any in-progress tasks to complete, refresh the page, and try again. Check status.lovable.dev if the issue persists.

Does connecting GitHub back up my entire Lovable project?

GitHub backs up all your source code, configuration files, and static assets in /public. It does not back up your Supabase database contents, user accounts, or Supabase Storage files. Those require separate backup through Supabase tools or a data export component.

How do I download my Lovable project as a ZIP file?

Open Dev Mode (click + next to Preview → Code panel, requires paid plan). In the file tree, use the download option to export the entire project as a ZIP. This ZIP contains all source files and can be run locally with npm install and npm run dev.

How do I back up my Supabase database in Lovable?

For self-hosted Supabase: use the dashboard's built-in backup tools. For Lovable Cloud-managed Supabase: create a data export component that queries each table and downloads the results as JSON files. Database backups are not included in code backups (GitHub or ZIP).

Can I import a Lovable project backup into a new project?

You cannot import a GitHub repo or ZIP directly into Lovable — Lovable only creates new projects from scratch or by duplicating existing ones. However, you can use the code from your backup in any standard development environment (VS Code, Cursor) since Lovable projects are standard Vite + React apps.

What if I need help setting up a comprehensive backup system?

A complete backup strategy covering code, database, and storage across Lovable, GitHub, and Supabase involves coordinating multiple systems. RapidDev's engineers have set up production backup workflows across 600+ Lovable projects and can build an automated backup system tailored to your project.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your issue.

Book a free consultation

Need help with your Lovable project?

Our experts have built 600+ apps and can solve your issue fast. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.