# From Heroku, dynos and all

Tell your AI “Move my Heroku app to BitHut”. It brings the config vars, the Postgres data and the code, checks the app here, and only then do you turn Heroku off.

## Tell your AI

1. Connect BitHut to your AI (Claude, ChatGPT or Codex): add the address `https://api.bithut.app/mcp`. How: https://bithut.app/connect.md
2. Then tell it:

```
Move my Heroku app to BitHut
```

## How the move goes

1. **Connect BitHut once.** Add BitHut to Claude Code, Codex or Cursor, in the folder of your app.
2. **Config vars into a file.** Your AI runs heroku config -s, which writes the app's config vars as a .env file on your computer.
3. **Code, keys, database.** The code comes from GitHub or your folder, the keys from the file, the Postgres data straight from Heroku. The app waits here, paused.
4. **You switch over.** Scale the Heroku dynos to zero and turn the Scheduler job off. Your AI resumes the app on BitHut and checks it works.

## What your AI takes from Heroku

- **Config vars.** `heroku config -s` prints them as `KEY=value` lines for a `.env` file, and from there they go straight into BitHut's secret storage.
- **Heroku Postgres.** It is reachable from outside (not on Private and Shield plans) and needs SSL. The address changes when credentials rotate, so your AI takes a fresh one with `heroku pg:credentials:url` right before the copy.
- **The code.** If the app deploys from GitHub, BitHut deploys from the same repository. If you pushed with git from your computer, the code is in your folder.
- **The dynos.** A web dyno becomes a site, a worker dyno a project that runs all the time, a Heroku Scheduler job a script on a schedule.

## No files to bring

Heroku's file system is wiped on every restart, so there is nothing on a disk to move. On BitHut a project has a disk that keeps its files.

## If something goes wrong

The database copy starts with a restore point of the project's own database, and the data from before stays for 7 days. Keep the Heroku app at zero dynos, not deleted, for at least 3 days.

## Templates to start from

- [Telegram bot](https://bithut.app/templates/telegram-bot.md): A bot in Telegram that does what you ask: answers customers, takes bookings, reminds, looks things up. It stays online even when your laptop is closed.
- [Daily report](https://bithut.app/templates/daily-report-to-telegram.md): Every morning it takes yesterday's numbers and sends a short summary to your team chat, your e-mail or both.
- [Lead form](https://bithut.app/templates/lead-intake.md): A form for your clients. Every request is saved and reaches you where you work: e-mail, Telegram, Slack and more.
