How do I test changes to my AI-built app without breaking the live one?
Short answer: Keep a second copy of your app, called a staging site, that has its own fake data, its own test payments and its own test emails. Try every AI change there first, and only copy it to the live app when it works. The key is the data: a copy of the screens is not enough if both copies share one database. Lovable, Bolt and Replit are tools where you describe an app in chat and an AI builds it, and each handles this a little differently.
Every time you ask the AI for a change, you are editing the app your customers use, and you want a safe place to try it first.
I'm Ranjit, and I run Blur Studio: 15+ years building software, 120 apps taken live, and clients who have gone on to raise $10M+. I build AI systems and processes that help businesses do a lot more with a lot less time. I also work differently from most of what else is out there, more on that further down this page. Say hello.
A "staging" copy is just a rehearsal space. It looks like your live app, but nothing that happens there can touch a real customer, a real payment or a real email. Big companies do this by default. Most owners of AI-built apps do not, because the builders make it easy to edit the live thing directly. That is how a small tweak to the checkout ends up taking down the checkout on a Friday afternoon.
The good news: you can set up a basic version in about 30 minutes. This page shows you what a staging copy needs, how to set it up, and a release routine you can follow every time.
What a staging copy actually needs
People copy the screens and forget the rest. A safe test copy needs four separate things:
- Its own code copy. A place to change things that is not the live version.
- Its own database. Separate fake records, so a test never edits or deletes a real customer.
- Its own payment mode. Test cards only, no real money.
- Its own email settings. Test messages go to you, never to customers.
If any of the four is shared with the live app, you do not have staging. You have a nervous copy.
The trap: copies that share the same data
This is the part almost every beginner guide skips. Lovable's drafts feature is a good example. Lovable's docs say a draft is a separate copy of your project where changes stay until you accept them, and accepting a draft does not change your published app. But the docs also warn that every draft uses your project's real backend and data. If you edit or delete a record while testing in a draft, the change is real and shows up in your published app too. Deleting the draft does not undo it.
So a draft protects your screens and code, but not your data. Use drafts for design and wording changes. For anything that writes data (forms, orders, accounts), you need a separate database as well, or at minimum your own test records that you create and never touch real ones.
The 30-minute setup
Step 1: Put your code in GitHub (5 to 10 minutes)
GitHub is a website that stores your code and its full history, so you can compare versions and go back. Lovable's Git sync connects a project to a GitHub, GitLab or Bitbucket repository you own, with two-way sync, on all plans. Replit has Git support too. In the repository, make a second "branch" called staging. A branch is a separate line of work: Replit's Git guide describes it as a place to make changes while the default branch stays unchanged. See my guide on moving an AI-built app to production for the longer version.
Step 2: Give staging its own address (10 minutes)
Vercel is a hosting service for web apps. Its docs say preview deployments let you test changes in a live setting without affecting production, and that every environment can have its own variables such as database details and keys. Its docs also describe a "preview branch for staging" setup that works on all plans, including the free Hobby plan: a long-lived staging branch with its own address and its own variables. Other hosts have similar features. For a comparison, see where to host an AI-built app.
Step 3: Give staging its own database (10 minutes)
Supabase is a hosted database and login service that many AI builders use. The simplest safe route is a second Supabase project just for staging, with its own keys. Supabase also has Branching: each branch is a separate environment with its own instance and keys, and by default a new branch has no data from your main project, which protects real customer data. Check Supabase's pricing page to see which plans include branching.
On Replit the split is built in. Replit's docs say every app has a development database and, once you publish, a production database. Agent can change the development one but cannot modify the production one. That is a good safety rule, as long as you know which one you are looking at.
Fill the staging database with fake people and fake orders. Never copy real customer records into staging unless you have removed names, emails and phone numbers. Real data in a test copy is a privacy problem waiting to happen.
Step 4: Switch payments to test mode (5 minutes)
Stripe is a payment service that takes card payments for businesses. Its docs describe a sandbox, an isolated test environment where payments are not processed by card networks, with test card numbers and its own keys. Put the test keys in staging and the live keys only in production. Store keys in environment variables or a secrets vault, never in the code itself, which is also Stripe's advice.
Lovable handles this itself: its docs say test mode applies in the preview, where only test card numbers work, and live mode applies to your published app. Each has its own products, prices and transaction history.
Step 5: Redirect test emails
Point staging at a test inbox or your own address, so a "your order shipped" test never reaches a customer. How you do this depends on the email service. Many let you set the sender and recipient through environment variables. Ask your builder or developer to add one setting: "in staging, send everything to this one address".
The release routine
Do the same thing every time. Copy this checklist.
- Make the change in staging only.
- Test the new thing, then test the three most important old things: sign in, the main thing customers do, and anything involving money.
- Test on a phone as well as a computer.
- Ask one other person to try it. People who did not build it find different problems.
- Write down what changed, in one line.
- Pick a quiet time to release, not Friday afternoon.
- Release to the live app.
- Check the three most important things again, on the live app, straight away.
- Know how to go back. In a Git setup, that means returning to the previous version. Replit's checkpoints and rollbacks are an option too. Remember that going back in code does not undo changes to the database.
Common mistakes
- Test keys in live, or live keys in test. Check this first when payments act oddly.
- Sharing one database between both. The most expensive mistake on this list.
- Letting the AI edit the live app "just this once". It never stays once.
- Forgetting secrets. Replit's docs warn that secrets set in the editor do not automatically carry over to a published app. The same is true across any two environments.
- Letting staging pages get found. Keep staging private or password-protected so search engines and customers do not stumble on it.
For the wider checklist of what makes an AI-built app safe to run, see is your vibe-coded app production ready and vibe coding best practices. If things already break, why AI-built apps break explains the usual causes.
When to get outside help
You can do most of this yourself for a simple app. Get a developer when the app handles payments or personal data, when it has more than one environment already tangled together, or when you cannot tell which database it points to. That last one is more common than you would think, and a developer can usually find out quickly. If you want a professional review, see what a code audit includes and costs.
How I'd approach this
If I owned an AI-built app with real customers, I would not make another change until I had staging. The order I would follow: code in GitHub first, then a separate database, then test payment keys, then test email, then a hosted staging address. Every step is small, and the first two give you most of the safety.
I would also keep the live app's admin access to as few people as possible, and make the AI work only in staging. If you do not want to set this up yourself, the Go-Live Plan Audit at Blur Studio is a written plan before launch: it checks what stands between your app and real users and gives you the list. Either way, do it before the next change, not after the next problem.
Questions people ask
What is a staging environment in simple words?
It is a private copy of your app used for rehearsal. It has its own fake data, its own test payments and its own test emails, so you can try changes without touching real customers. When a change works there, you copy it to the live app.
Is a Lovable draft the same as staging?
Not fully. Lovable's docs say a draft keeps your code changes separate until you accept them, but it uses your project's real backend and data, so edits or deletes made while testing are real. Use drafts for design and wording, and use a separate database for anything that writes data.
Do I need a separate database for staging?
Yes, if your app writes data. Without one, a test can edit or delete a real customer's record. Supabase offers branches with their own instance, and a second project also works. Replit gives every app separate development and production databases.
How do I test payments without taking real money?
Use the payment provider's test mode. Stripe's sandbox accepts test card numbers and uses its own test API keys. Keep test keys in staging and live keys only in production.
Does staging cost extra?
It can be free or cheap for a small app. Vercel's docs list a staging setup that works on all plans, including free Hobby, but check current pricing for your host and for any extra database project or branch. Check each provider's pricing page before you add one.
How often should I release changes?
As often as your checklist allows. Small, frequent releases are easier to test and easier to undo than one big monthly release. Always release at a quiet time and check the main customer path straight afterwards. For where to host, see where to host an AI-built app.
More in this topic: Problem solving: AI-built and no-code apps (26 guides) →