Skip to main content
DOCS

Migrate an existing app

Import the backend of an existing codebase into a workspace and swap your ORM calls for the SDK.

Bring an existing app to Codata

Already have a codebase with Prisma, Mongoose, SQLAlchemy, or raw SQL? Point your connected coding agent at it. The agent analyzes your models, routes, and infrastructure, then submits the findings to Codata, which builds a workspace spec from them: entities, fields, relationships, and endpoints included.

How the import works

  1. Analyze

    Your agent reads the project: framework and dependencies, model definitions, database relationships, API routes, auth pattern, and supporting infrastructure (caches, queues, storage, search).

  2. Import

    The structured analysis is submitted via the workspaces-import-analysis tool. Codata generates workspace assets from it and returns the draft spec.

  3. Review

    You see exactly what was detected — "Found 5 models: User, Post, Comment, Like, Tag; Prisma + PostgreSQL; ~20 endpoints" — and adjust anything that's off before generating.

  4. Migrate the code

    workspaces-getMigrationGuide returns step-by-step instructions tailored to your detected stack, showing how each database call maps to the SDK:

    // before                                   // after
    prisma.user.create({ data })         →      ws.post("/users", data)
    prisma.user.findMany({ where })      →      ws.get("/users", filters)

What gets imported

Entities & fields
Models become workspace assets with types, required flags, and unique constraints.
Relationships
Foreign keys and references become explicit one-to-many / many-to-many links.
Endpoints
Detected API routes seed the generated endpoint set.
Infrastructure
Caches, queues, and search are recorded as context for the migration guide (not migrated as-is).
Auth
Your existing auth pattern is noted; it's replaced by Codata's managed auth service.

After import the workspace is a draft — review the spec, then generate. Your old database stays untouched until you decide to cut over.