DEV Community

Paweł Reszka
Paweł Reszka

Posted on • Originally published at inigra.eu

How to Move Your Lovable or Replit Project to Your Own Infrastructure (Step-by-Step)

You built something on Lovable or Replit. It works. Now you want to own it — run it on your own infrastructure, stop burning credits, and have full control over your code.

This guide walks you through every step in plain English. No assumed knowledge. Windows and Mac instructions throughout.


Before You Start

Moving a project from Lovable or Replit is a bit like moving house. It's not instant, and there's a checklist to follow — but once you're done, your project is yours, living on infrastructure you control.

How long will this take?
A simple project (just a website, no database): about 1-2 hours. A project with a database and logins: plan for a half day.

Do this NOW before anything else:
Take a screenshot of your working project. Note down every feature that works today. This is your "before" picture so you can confirm everything works the same after moving.

Things you'll need:

  • A computer running Windows or Mac
  • A free GitHub account
  • About 1-4 hours of uninterrupted time
  • Access to your Lovable or Replit project (logged in)
  • A notepad or text file to save passwords and settings as we go

Step 1: Install Git and Get Your Code

Git is a free tool that saves every version of your code. Think of it as undo/redo on steroids. Every change you make gets saved in history, so you can always go back.

Install Git

Windows:

  1. Go to git-scm.com/download/win — the download starts automatically.
  2. Open the downloaded file. Click Yes if Windows asks for permission.
  3. Click Next through all the screens — the defaults are fine. Click Install, then Finish.
  4. Check it worked: press the Windows key, type cmd, press Enter. Type git --version. You should see a version number.

Mac:

  1. Open Terminal: press ⌘ Command + Space, type Terminal, press Enter.
  2. Type xcode-select --install and press Enter. A window will pop up asking to install Developer Tools. Click Install. Wait 5-15 minutes.
  3. Check it worked: type git --version. You should see a version number.

Download your code

From Lovable:

  1. Open your project in Lovable and click the GitHub icon in the top bar.
  2. Click "Connect to GitHub" or "Push to GitHub". Log in to GitHub and allow access if asked.
  3. Lovable will create a repository on your GitHub account. Write down the URL — it looks like https://github.com/your-name/your-project.
  4. Alternatively, use the Download ZIP option if available.

From Replit:

  1. Open your project. In the left sidebar, look for the three dots menu or click "Version Control" / the Git icon.
  2. Click "Connect to GitHub" and follow the steps to push your code to a new GitHub repository.
  3. Or download directly: click the three dots next to your project name → "Download as ZIP".
  4. If you downloaded a ZIP: right-click and choose Extract All (Windows) or double-click to unzip (Mac).

Open a command window in your project folder

A command window is a text-based way to give your computer instructions. It sounds scary but we'll only type a few simple things.

Windows:
Open File Explorer, navigate to your project folder, click the address bar at the top, type cmd and press Enter. A black window opens already inside your project folder.

Mac:
Open Finder, find your project folder, right-click it and select "New Terminal at Folder".

Now type these commands one at a time, pressing Enter after each:

# Tell Git who you are (use your GitHub name and email)
git config --global user.name "Your Name"
git config --global user.email "you@example.com"

# If your code isn't from GitHub yet (downloaded ZIP), run these:
git init
git add .
git commit -m "My project, first save"
Enter fullscreen mode Exit fullscreen mode

Step 2: Save Your Secret Settings

Every app has settings and passwords stored behind the scenes. We need to copy these before moving.

Think of environment variables as the keys to your app's locked doors — passwords for your database, secret codes for payment systems, and connection details. Without them, your moved app won't work.

Finding your settings in Lovable

  1. In your Lovable project, click on the Cloud icon at the top.
  2. Look for a section called "Secrets".
  3. Write down every single variable — the name on the left and the value on the right. Keep this somewhere safe.
  4. Also note your Supabase URL and keys — go to your Supabase project → Settings → API and copy the Project URL, anon/public key, and service_role key.

Finding your settings in Replit

  1. Open your project. In the left sidebar, click the 🔒 Secrets padlock icon.
  2. You'll see a list of your secrets. Each one has a key (the name) and a value.
  3. Click each secret and copy the value. Write them all down. They will NOT be exported with your code automatically.
  4. Also note if you're using Replit's built-in Database — if your code mentions @replit/database, you'll need to export that data separately.

Common variables and what they do

Variable Name What it is Need on new host?
VITE_SUPABASE_URL / NEXT_PUBLIC_SUPABASE_URL The address of your database Yes
SUPABASE_ANON_KEY / VITE_SUPABASE_ANON_KEY A public key for reading your database Yes
SUPABASE_SERVICE_ROLE_KEY A powerful private key Yes — never share publicly
OPENAI_API_KEY / ANTHROPIC_API_KEY Your AI service password Yes — rotate after migration
STRIPE_SECRET_KEY / STRIPE_WEBHOOK_SECRET Payment processing keys Yes — update Stripe dashboard
DATABASE_URL Full address + password of your database Yes — will change on new host
NEXTAUTH_SECRET / JWT_SECRET Secret code for user login security Yes
NEXTAUTH_URL / PUBLIC_URL The web address of your app Yes — will change to your new address

⚠️ You can copy your existing keys directly to your new hosting platform and everything will keep working. As a best practice, eventually rotate your API keys — especially for payment services and AI APIs. You don't need to do this today; just keep it on your to-do list.

Create your .env file

Windows:

  1. Open Notepad. Type your variables:
VITE_SUPABASE_URL=https://xxxxx.supabase.co
VITE_SUPABASE_ANON_KEY=your-key-here
OPENAI_API_KEY=sk-xxxxxxxxxxxx
Enter fullscreen mode Exit fullscreen mode
  1. Click File → Save As. Navigate to your project folder. In "Save as type", choose "All Files (.)". Name the file exactly: .env (with the dot). Click Save.

Mac:

  1. In your Terminal (already in your project folder), type nano .env
  2. Type your variables (same format as above).
  3. Press Ctrl + X to exit, then Y to save, then Enter to confirm.

🚨 Never upload your .env file to GitHub! It contains passwords. Make sure it's listed in your .gitignore file:

echo ".env" >> .gitignore

Step 3: Save Your Data

If your app lets users sign up, saves any information, or has content that changes — you have a database. If it's a simple display-only website with no logins, you probably don't.

Supabase (Lovable projects)

  1. Log in at supabase.com and open your project.
  2. Go to Project Settings → Database.
  3. Use the Table Editor to export each table as CSV: go to a table, click Export, save the file.

💡 Easiest path: keep Supabase. You don't have to move your database at all. Just deploy your code to a new host and keep using the same Supabase project. Copy your Supabase URL and keys to the new host's environment variables. Done.

Replit's built-in database

⚠️ Replit's database is a simple key-value store that doesn't export easily. If your app uses @replit/database, you'll need to replace it with a real database after moving. Supabase, Neon, or Turso are all good free options.

To export your data, open the Shell tab in Replit and run:

node -e "const D=require('@replit/database');
const d=new D();
d.list().then(k=>Promise.all(k.map(async key=>
({key,val:await d.get(key)}))).then(r=>
console.log(JSON.stringify(r,null,2))))"
Enter fullscreen mode Exit fullscreen mode

Copy the output and save it as replit-data-backup.json.


Step 4: Deploy to Your New Home

For most Lovable/Replit projects: Vercel (for React/Next.js) or Railway (if you have a backend server). Both have free tiers.

Deploy to Vercel

  1. Make sure your code is on GitHub (from Step 1). Go to vercel.com and click Sign Up → Continue with GitHub.
  2. Click Add New Project → Import your GitHub repository.
  3. Before clicking Deploy, find the Environment Variables section and add all the variables you saved in Step 2. Add them one by one.
  4. Click Deploy. After 1-3 minutes, you'll get a URL like your-project.vercel.app. Open it and test everything.

Test everything before moving your domain

Don't touch your domain until this checklist is green:

  • [ ] Homepage loads without errors
  • [ ] User sign up works (if you have auth)
  • [ ] User login works
  • [ ] Any forms submit correctly
  • [ ] Images and files load
  • [ ] If you have payments — test with Stripe's test card (4242 4242 4242 4242)
  • [ ] Check on your phone too
  • [ ] Compare with your "before" screenshots from the beginning

Move your custom domain (if you have one)

Only do this once all tests pass. DNS changes can take up to 48 hours to update worldwide.

  1. In Vercel: go to your project → Settings → Domains → add your custom domain.
  2. Vercel will show you DNS records to add. Log in to wherever you bought your domain and update those records.
  3. After your domain is working, update the NEXTAUTH_URL or PUBLIC_URL environment variable to your real domain name.

Step 5: Set Up Claude Code (Optional)

Once your code is running locally, you can use Claude Code to make changes instead of going back to Lovable or Replit. It runs in your terminal — you describe what you want in English, it reads your code and makes the changes. No credits.

Install Claude Code

In your terminal (Windows Command Prompt or Mac Terminal):

npm install -g @anthropic-ai/claude-code
Enter fullscreen mode Exit fullscreen mode

Get your API key

  1. Go to console.anthropic.com
  2. Create an account if you don't have one
  3. Go to API Keys → Create Key → Copy it

Connect and start using it

Windows:

set ANTHROPIC_API_KEY=your-key-here
claude
Enter fullscreen mode Exit fullscreen mode

Mac:

export ANTHROPIC_API_KEY=your-key-here
claude
Enter fullscreen mode Exit fullscreen mode

Claude Code will start and you'll see a prompt where you can type in plain English.

Try your first command:

Read the project structure and tell me what this app does
Enter fullscreen mode Exit fullscreen mode

It will analyse your entire codebase and explain it back to you. On Lovable, that would have cost credits. Here it's just a conversation.

Try making a change:

Change the main heading colour to blue
Enter fullscreen mode Exit fullscreen mode

It will find the right file, show you what it's going to change, and ask for permission. Say yes, then refresh your browser.

After making changes, save them to GitHub:

git add .
git commit -m "describe what you changed"
git push
Enter fullscreen mode Exit fullscreen mode

💡 Claude Code uses Anthropic's API which charges per usage — not per edit like Lovable, but per amount of text processed. For typical small changes it's pennies. Much cheaper than platform credits for ongoing work.


Choosing a New Home

For your app

Platform Best for Price
Vercel React/Next.js projects Free to start
Netlify Any website Free to start
Railway ⭐ (Replit users) Apps with a backend server From $5/mo
Render Any kind of project From $7/mo

For your database

Platform Best for Price
Keep Supabase Easiest — don't move it at all Free to start
Neon PostgreSQL, similar to Supabase Free to start
Turso Replacing Replit's built-in DB Free to start

Final Migration Checklist

  • [ ] Code exported and on GitHub
  • [ ] All environment variables copied from old platform
  • [ ] .env file created locally (and in .gitignore)
  • [ ] Database backed up (or confirmed staying on Supabase)
  • [ ] Deployed to new host (Vercel, Railway, etc.)
  • [ ] All environment variables added to new host
  • [ ] App fully tested on new host URL
  • [ ] Custom domain pointed to new host (if applicable)
  • [ ] 🔑 Remind yourself to rotate API keys when you have time
  • [ ] 💸 Cancel your old Lovable/Replit subscription (only once 100% working)

You did it. Your project is now running on infrastructure you control. No more platform-specific lock-in, no more surprise pricing changes. From here, your code deploys automatically every time you push to GitHub.


Full version with screenshots and interactive tabs: inigra.eu/nocodemigration

If you'd rather have someone handle the migration, we do this every week: Book a free discovery call

Top comments (0)