Hosting operations2 minutes to read

How do I move my bot from Render, Railway or Replit to another host?

A safe checklist for moving a running Discord or Telegram bot between hosts: export data, copy secrets, cut over without double replies and roll back.

Copy, test, stop the old one, then start the new one

Export your code, data and environment variables from the old host. Recreate them on the new host and test with a separate bot token if you can. Then stop the old process and start the new one with the real token. Never run both at once. Two processes on one Discord token reply twice, and two Telegram pollers fight over updates.

What to take with you

  • Code. Usually already in Git. On Replit, download the project as a ZIP so files outside Git come too.
  • Data. SQLite files, JSON stores or a database dump. Render and Railway file systems may reset on redeploy, so check whether your bot stored data there at all.
  • Variables. Bot tokens, API keys and database URLs. Copy them into a password manager, not a file in the repository.
  • Webhooks. Note any Telegram webhook URL or Discord interactions endpoint pointing at the old host.

Cut over on Bothosting

  1. Create the deployment with the matching profile. Connect the GitHub repository or upload the ZIP.
  2. Add the variables. Upload data files, or restore a dump into a PostgreSQL deployment.
  3. Stop the bot on the old host. For Telegram, update or delete the webhook.
  4. Start the new deployment, watch Console and run a command that reads saved data.

Keep a way back

Leave the old service stopped but not deleted for a few days. If something breaks, stop the new deployment and start the old one. Once you are happy, delete the old service and rotate the bot token so only the new host knows it. To compare costs before moving, see Bothosting vs Railway, Render and Fly.io.