
# Migrate from Airtable to Sovrium

You have an Airtable base and want to own it — self-hosted, config-as-code, no per-seat pricing. A base maps almost one-to-one onto a Sovrium table.

## Map the field types

Export the base first (in Airtable: **... → Download CSV** per table). Most Airtable field types have a direct Sovrium equivalent:

| Airtable field         | Sovrium `type`            |
| ---------------------- | ------------------------- |
| Single line text       | `single-line-text`        |
| Long text              | `long-text`               |
| Email / URL / Phone    | `email` / `url` / `phone` |
| Single select          | `single-select`           |
| Multiple select        | `multiple-select`         |
| Number / Currency      | `number` / `currency`     |
| Date                   | `date`                    |
| Checkbox               | `checkbox`                |
| Attachment             | `attachment`              |
| Link to another record | `relationship`            |

## Define the table

Declare each column as a Sovrium field. This `contacts` table is a complete, runnable app:

```ts
export default {
  name: 'contacts-app',
  version: '1.0.0',
  tables: [
    {
      name: 'contacts',
      fields: [
        { name: 'full_name', type: 'single-line-text', required: true },
        { name: 'email', type: 'email' },
        { name: 'company', type: 'single-line-text' },
        { name: 'status', type: 'single-select', options: ['lead', 'active', 'churned'] },
        { name: 'notes', type: 'long-text' },
      ],
    },
  ],
}
```

## Run it

```bash
sovrium start app.ts
```

## Verify

Open `http://localhost:3000/api/tables/contacts/records` — the table exists and is empty, ready for your CSV import via the records API.

## What doesn't map

Airtable **formulas, rollups, and automations** are not columns you paste in — Sovrium has its own [formula and rollup fields](/en/docs/advanced-fields) and a separate [automations](/en/docs/automations-overview) engine, so re-declare that logic rather than importing it. Airtable **views** become Sovrium [page views](/en/docs/pages-overview).
