# From Replit to a home of its own

Tell your AI “Move my Replit app to BitHut”. It brings the code, the secrets and the production data, checks the app here, and only then do you turn the Replit deployment 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 Replit app to BitHut
```

## How the move goes

1. **Get the code out.** Push it to GitHub from Replit's Git pane, or download it as a zip and open the folder in Claude Code, Codex or Cursor.
2. **Secrets into a file.** Copy the app's production secrets into a .env file on your computer: Replit can show them all as .env text.
3. **Code, keys, database.** BitHut takes the code, the keys from the file and the production Postgres data. The app waits here, paused.
4. **You switch over.** Turn the Replit deployment off. Your AI resumes the app on BitHut and checks it works.

## What your AI takes from Replit

- **The code.** Only what is committed goes to GitHub, so commit first. A zip download works as well.
- **Secrets.** A published app has its own production secrets, separate from the ones in the editor. Those are the ones to copy.
- **The database.** The development database is not reachable from outside; the production one is, with the address from the database's Settings tab. Older apps may keep it in `NEON_DATABASE_URL`.
- **Files.** Files in App Storage are downloaded from Replit and go onto the project's disk here.

## What changes in the code

Your AI looks for Replit-only pieces, such as Replit's own database client or storage library, and swaps them for what runs anywhere: the project's Postgres and its disk. That happens before the switch, while the Replit copy still runs.

## 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 Replit app for at least 3 days after the switch.

## 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.
- [Dashboard from Google Sheets](https://bithut.app/templates/sheets-dashboard.md): A web page with charts from your Google Sheet, behind a password, for your team.
