> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reliantlabs.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate an existing app to forge

> Three ways to bring an app you already have onto forge: adopt it as it is from its Dockerfile, adopt a Vite or Next.js site in place, or port a Go codebase with the Move to Forge workflow.

You don't have to start from an empty directory. forge is a set of independent pieces, and an app that already exists can take as many as it wants and stop at any point. Which path fits depends on what the app is.

| Your app | Path | What changes |
| - | - | - |
| A Vite or Next.js frontend with no server | [Adopt it as a site](#a-vite-or-nextjs-site) | Nothing in your files. forge adds its config beside them. |
| A server in any language (Node, Python, Ruby, Java, Go) with a Dockerfile | [Adopt it from its Dockerfile](#an-app-with-a-dockerfile-in-any-language) | Nothing in your files. forge deploys the image your Dockerfile builds. |
| A Go codebase you want on forge's generated API, ORM and frontend hooks | [Port it with Move to Forge](#a-go-codebase-the-move-to-forge-workflow) | A port, one component at a time, in a new project beside the old one. |

If you aren't sure, adopt first. It is the cheapest path, it changes none of your code, and it doesn't rule out porting later.

## Ask an agent

In a Reliant chat in your project, ask the agent to bring the app to forge. The agent loads forge's `adopt` skill, which has it survey the repo, tell you what forge would do and roughly how long each step takes, and let you pick a starting point, before it writes anything. You can read the same skill yourself with `reliant forge skill load adopt`.

## A Vite or Next.js site

A frontend with no backend of its own is a complete forge project. From the app's root, where `package.json` is:

```bash theme={null}
reliant forge project new --in-place --kind site --name my-site
```

This writes `forge.yaml` and `deploy/kcl/{dev,staging,prod}/main.k` and merges forge's entries into `.gitignore`. Your files are untouched. `dev` binds to your dev server, and `staging` and `prod` bind to Reliant's hosted static hosting. Then `reliant forge env deploy prod` builds the site and publishes it. One static site per organization is free, counted across its environments, and a Next.js app must build as a static export (`output: "export"`); `reliant forge lint --static-export` names anything that can't be served. To deploy with no account at all, [Deploy a Vite or Next.js app without an account](https://docs.reliantlabs.io/forge/deploy-without-an-account.md).

## An app with a Dockerfile, in any language

forge never compiles your code in this path. It reads your Dockerfile and compose file, then builds and deploys the image. In the app's root:

```bash theme={null}
reliant forge project new --in-place --kind app --dry-run     # what it found, and every file it would write; writes nothing
reliant forge project new --in-place --kind app --name myapp  # write them
```

It writes `forge.yaml` and `deploy/kcl/` and changes nothing else except forge's block in `.gitignore`. From what it reads, it declares a workload built from your Dockerfile with its port and a health probe, a managed Postgres for staging and prod when it sees a database, a migration job that runs your own migrate command before each rollout, and a managed secret for each credential it finds. Without `--kind`, `--in-place` refuses a directory that has a Dockerfile and no Go module rather than write a Go server into your app. Every assumption it made is marked with a `# check:` line in the file; read them before the first deploy.

Then `reliant forge env up dev` runs the app locally, and `reliant forge env deploy staging` ships it to [Reliant hosting](https://docs.reliantlabs.io/hosting/overview.md). A hosted workload or database needs hosting billing; until it is active the deploy is queued, not refused. [Deploy an existing app from its Dockerfile, in any language](https://docs.reliantlabs.io/guides/forge/bring-existing-app-any-language.md) walks through every step with real output.

The path is built in tiers, and each is complete, so you can stop after any of them:

| Tier | You get | It takes |
| - | - | - |
| 1. Ship it | dev, staging and prod; hosting with managed Postgres and secrets; redeployable releases | About an hour, no code change |
| 2. See it | traces, metrics, dashboards, alerts and real `obs check` verdicts | An OpenTelemetry SDK in the app |
| 3. Harden it | Promotion gated on staging, deploys from CI, real health probes | A little configuration per environment |
| 4. Move in | forge's Go stack: generated API, ORM and typed frontend hooks | A port, only when it pays |

Until Tier 2, the app reports no request telemetry, so `reliant forge obs check` can't prove a release good and says so. Hosting sets `OTEL_EXPORTER_OTLP_ENDPOINT` for you; the app has to read it.

You can even skip deploying with forge: `reliant forge obs init <env>` gives any app hosted dashboards and alerts, and `reliant forge release record` records the deploys your own CI makes. `reliant forge skill load adopt/monitoring` and `deploy/record` cover those. A person has to run `obs init`; an agent's shell is refused. Reliant's cloud doesn't accept recorded releases yet, so `release record` is refused there today.

## A Go codebase: the Move to Forge workflow

A Go service that should become a generated forge project is ported rather than adopted. **Move to Forge** (`forge-migrate`) is the built-in workflow for it. Pick it in the chat's workflow selector, or from a terminal:

```bash theme={null}
reliant workflow run forge-migrate --project-path .
```

It works in five phases:

1. **Inventory.** An agent reads the repo first, because the code answers most questions, and asks you only what code can't: scope, module path, how close to the original the port must be. It writes `MIGRATION_PLAN.md` in the source repo with an ordered list of components, dependencies before dependents.
2. **Approval.** It stops and asks you to approve the plan, and waits up to 24 hours. Nothing is created before you say yes. If you decline, the plan stays in `MIGRATION_PLAN.md` for you to edit and rerun.
3. **Scaffold.** It creates a forge project beside your repo, never in place, and gets a green baseline before any porting starts.
4. **Port.** It ports the components in order, one at a time, and each must pass generate, lint, build and tests before the next starts. It stops at the first component that can't go green and records how far it got.
5. **Converge.** It wires the pieces together, checks the parity list and writes an honest summary of what it deferred.

The source repository is not modified, so a stopped migration costs you nothing. If the app isn't Go, the workflow recommends adoption first, since forge can deploy it as it is. For a Go app too large to fork, the in-place route (`reliant forge project new --in-place --kind service`, one service per pull request with `// forge:unmanaged`) is described in `reliant forge skill load migration`.

## Limits

* Adoption doesn't instrument your app or write CI. See the tiers above.
* A port is real work and takes real review. Move to Forge is a starting point that keeps every step gated, not a one-click conversion.
* Hosted workloads and databases need billing, and the migration job runs before each rollout, so keep schema changes backward-compatible. Hosting never rolls back; you recover by deploying an earlier release.
* forge generates Go services. A server in another language stays in its language.

## Related topics

* [Deploy an existing app from its Dockerfile](https://docs.reliantlabs.io/guides/forge/bring-existing-app-any-language.md): the full walkthrough
* [Adopt an app that already exists](https://docs.reliantlabs.io/forge/deploy/escape-hatches.md#adopt-an-app-that-already-exists): the tiers and what the declarations mean
* [Forge quick start](https://docs.reliantlabs.io/forge/quick-start.md) for a new project, and [Project anatomy](https://docs.reliantlabs.io/forge/project-anatomy.md)
* [Workflows](https://docs.reliantlabs.io/workflows/overview.md#beyond-the-agent-workflow): Move to Forge among the built-ins
* [Managed Postgres](https://docs.reliantlabs.io/hosting/managed-postgres.md) and [Environments](https://docs.reliantlabs.io/forge/deploy/environments.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.