The Lovable.dev Migration Guide: Moving from personal GitHub to an organization (without breaking sync)
Source: Dev.to
Why the standard migration fails
- If you transfer a repository while it is connected to Lovable, the sync will break—often permanently.
- Lovable does not support “Bringing Your Own Repository” (BYOR) for existing projects. After a manual transfer, Lovable will refuse to reconnect and will insist on creating a duplicate repository (e.g.,
my-org/my-app-1). - Most developer tools (Vercel, Netlify, etc.) treat GitHub as the source of truth. Lovable works the opposite way: it creates the repository during the connection process.
Migration strategy (Lovable‑first approach)
We’ll sacrifice the Git commit history to keep the sync healthy:
- Archive the old repository instead of transferring it.
- Let Lovable create a fresh repository in the target organization.
- Re‑connect all external services to the new repository.
Pre‑migration backups
| What | How |
|---|---|
| Code backup | See the code block below. |
| Database backup | In Supabase Dashboard → Project Settings → Database → Backups, create a fresh backup. |
git clone https://github.com/your-user/your-repo.git
zip -r your-repo-backup.zip your-repo/
Note: Your Supabase database is loosely coupled (connected via Project ID), so moving the code will not delete your data.
Step‑by‑step migration
1. Rename the old repository
- Go to your personal GitHub repo and rename it (e.g.,
my-app-legacy). - This frees up the desired name (
my-app) for the new organization.
2. Pause external deployments
- If you use Coolify, Vercel, Netlify, etc., pause “Auto Deploy” to prevent them from pulling from the old URL.
3. Disconnect Lovable
- In Lovable → Project Settings → Integrations → GitHub, click Disconnect.
- Your code remains safe inside Lovable.
4. Re‑connect Lovable to the organization
- In Lovable → Settings → Integrations → GitHub, click Connect Project.
- Crucial: Select your target Organization as the destination.
- If the org doesn’t appear, click Add Organization to install the Lovable GitHub App on it.
- Lovable will prompt to create a repository. Name it
my-app(the name is now available). - Confirm. Lovable will push the current state of your app to
github.com/my-org/my-appas an Initial Commit. The sync is now live.
5. Update other tools
Hosting (Coolify / Vercel / Netlify)
- Change the Git source URL to the new organization repo.
- Ensure the hosting provider’s GitHub App is installed on the new organization, not just your personal account.
- Trigger a manual deployment to verify the pipeline.
Supabase (Branching)
- The database connection (URL / anon key) stays the same—no changes needed.
- If you use Supabase Branching, go to Supabase → Integrations → GitHub and reinstall the integration on the new organization repo.
Summary
- Do NOT use GitHub’s “Transfer Ownership” button for a Lovable‑connected repo.
- Disconnect Lovable first, then let it create a fresh repository in the target organization.
- Accept that the Git commit history will reset (keep the old repo as a read‑only archive).
- By following this “Lovable‑First” approach, you avoid the “Ghost Repository” trap and keep your project shipping smoothly.
Have you migrated a Lovable project recently? Let me know in the comments if you hit any other snags!