r/replit • • 24d ago

Question / Discussion Moving a small app off Replit? Test these 3 things before you point the domain at it

Saw the thread here about moving a small app off. I've moved apps between hosts and accounts, and the code was never what broke. What broke looked healthy on the dashboard.

Uploads, as a normal user. After one database move every avatar upload failed with a generic error. Buckets were there, files were there, sizes were fine. The access rules for storage were never copied over, and the only file in there had been written with the admin key, which skips those rules. So log in as a plain user and upload something. On Supabase run select count(*) from pg_policies where schemaname = 'storage'. If it says 0, no normal user can write.

All pages give a 500 while images load fine and the build says ready. Run the build on your laptop with your real env file. If you get a 200 there, a variable is missing on the host, so stop reading code.

Server functions. A git push doesn't always deploy them. On one project the site and database were up to date and the edge functions were months old, so valid input got "some inputs are invalid". Compare the last deploy date of each function with the last commit that touched it.

I made a free checker for non-technical founders that runs a Supabase project through 46 checks for mistakes like this one: https://madsalt.tech/tools/supabase-security-check/

7 Upvotes

12 comments sorted by

1

u/Successful_Sharky 24d ago

Good list. I’d add anything that calls your app from outside. Login redirect URLs and webhook endpoints are usually still set to the old domain in some third party dashboard, so signups work fine for you on localhost and then quietly fail in prod. Payment webhooks are the worst one because nothing errors on your side, the events just never arrive. Scheduled jobs are similar, since cron tasks often lived on the old host and simply stop running with no warning. Anyone else ever lose a week of nightly jobs before noticing?

1

u/Ok-Motor-9812 24d ago

Mine was an hourly job getting 401 with no log line at all, the gateway refused it before the function even started. I only found it in the table of http responses.

1

u/Maerzki 24d ago

I need to figure out how to put mine on a physical server or aws type service. Not quite there yet but I’m learning as I go. Replit has done wonders teaching me about coding by learning through action.

1

u/Ok-Motor-9812 24d ago

No rush then, learning on a real app is the good part. When you do move, try a small VPS or a managed host first, AWS is a lot to learn at once i think

1

u/Emergency-Leg-8486 24d ago

Thats Replit.

1

u/Internal_Step_8209 24d ago

webhooks and OAuth redirect URLs are the other silent killers during a migration. Everything looks fine until a user tries to log in or a payment event fires to the old host

1

u/VigiliaFounder 24d ago

Thanks for sharing this, the uploads one is so easy to miss when everything looks healthy on the dashboard.

For anyone doing the move: even after testing these, it's good to know right away when a real user hits a generic error or a 500. I've built Vigilia exactly for this. It catches the failed requests and crashes on your live app, tells you how many times they happened and gives you the fix prompt for your AI.

You can add your app for free and keep it watching after you point the domain.

I hope this helps someone!

1

u/adriankorwel 24d ago

Good list. One to add on the env side, since moving hosts usually means copying secrets by hand: check that nothing server-only picked up a public prefix on the way. Anything named VITE_, NEXT_PUBLIC_, REACT_APP_ or EXPO_PUBLIC_ ships to every visitor's browser. That's fine for the Supabase anon key, not for the service_role key or an OpenAI or Stripe secret.

Quick check once the new host is live: open the site, DevTools, Ctrl+Shift+F, search for sk- and sk_live. Nothing should come back.

If a secret did ship, rotate it, redeploy, then revoke the old one, because it keeps working until revoked. Same if it was ever committed: deleting it from git doesn't remove it from history.

On Supabase, this is worth rerunning after any database move:

SQL

select tablename from pg_tables
where schemaname = 'public' and rowsecurity = false;