Skip to content

Discovery: Data Migration from Shared to Isolated #774

Description

@2witstudios

Overview

Plan the migration from current shared database to per-tenant isolated databases.

Key Questions

  1. How to extract existing team data from shared DB?
  2. Schema management: Same schema per tenant or customizable?
  3. Migration tooling: pg_dump/restore, custom scripts?
  4. Cutover strategy: Big bang or gradual?
  5. How to handle cross-tenant features (if any)?

Current Data Model

  • drives (shared, with ownerId)
  • pages (shared, with driveId FK)
  • chat_messages (shared)
  • users (shared across teams)

Deliverable

Migration playbook with rollback plan.

Current State

The control plane (apps/control-plane/) handles tenant provisioning with per-tenant Docker projects and encrypted secrets. Multi-tenant isolation tests exist at packages/lib/src/__tests__/multi-tenant-isolation.test.ts. This discovery is about the actual data migration path from shared to isolated databases.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions