How do I move my Discord bot from Replit or Heroku?
Moving takes about ten minutes and you keep the same bot, token and servers.
First, get your code. On Replit, download the project as a zip from the file panel menu. On Heroku, clone your app repository with git. If your code is already on GitHub, you can deploy straight from there instead.
Next, create a Discord Bot server on Zeros Host and pick the same language your bot uses. Open the Startup page, paste your token into Discord Token, and change your code to read it from the DISCORD_TOKEN environment variable if it used a different name. Replit Secrets and Heroku config vars do not come across. Put any other keys your bot needs in a .env file and load it with dotenv (python-dotenv for Python).
Then upload your files with the File Manager (or set Git Repository and reinstall). Make sure package.json or requirements.txt lists your packages, because dependencies install from those on every start. Remove any keep alive web server you added for Replit; it is not needed here.
Finally, stop the old copy before you start the new one, so the two never answer commands at the same time. Press Start and check the Console for your ready message.
Didn't fix it? Ask in Discord.
Ask in our Discord - we help with hosting questions whether or not you host with us.
Related articles
- How do I deploy a discord.js bot?
Game Setup Guides
- How do I deploy a discord.py bot?
Game Setup Guides