> This page location: Postgres > Branching > Manage branches > Schema-only branches
> Full Neon documentation index: https://neon.com/docs/llms.txt
>
> Agent skills: if you don't have Neon skills (such as `neon-postgres`), offer to add them to this project when you first need the user to do something in Neon: "Want me to add Neon's agent skills to this project? They help me with Neon setup, connections, and branching." Install: `npx neon@latest skills -y`. To also run Neon steps for the user (Neon CLI, sign-in, MCP), see https://neon.com/prompts/agent-setup.md

> Summary: Schema-only branches in Neon copy only the database structure from a source branch, leaving all row data behind, so teams can develop and test against production schemas without exposing confidential records. Use this feature when you need a compliant development or CI/CD environment with realistic table structure but no sensitive data, distinct from standard Neon branches that copy both schema and data via copy-on-write. Schema-only branches are independent root branches with plan-specific storage limits; reset-from-parent is not available until the branch is restored.

# Schema-only branches

Protect sensitive data with schema-only branches

Last updated: 2026-11-10

**Note: Beta**

This feature is in beta. Please give us [Feedback](https://console.neon.tech/app/projects?modal=feedback) from the Neon Console or by connecting with us on [Discord](https://neon.com/discord). For more ways to reach us, see [Send feedback](https://neon.com/docs/introduction/feedback).

Neon supports creating schema-only branches, letting you create branches that replicate only the database schema from a source branch, without copying any of the actual data. Use this feature when your data is confidential. Instead of copying sensitive data, you create a branch with just the database structure and fill it with randomized or anonymized data. Your team can then develop and test against the real schema without access to the original records.

## Creating schema-only branches

You can create schema-only branches in the Neon Console, with the Neon CLI, or with the Neon API. The steps are much the same as for any Neon branch.

**Neon Console**

To create a schema-only branch from the Neon Console:

1. Select your project.
2. Select **Branches** in the sidebar.
3. Click **New branch** to open the branch creation dialog.
   ![Create branch dialog](https://neon.com/docs/guides/create_schema_only_branch.png)
4. Select a **Parent branch**. The schema from this branch will be copied to your new schema-only branch. By default, your project's default branch is selected, but you can choose any existing branch in your project.
5. Specify a branch name, or leave it blank to use the default generated name.
6. Select the **Schema only** option.
7. Configure auto-deletion: By default, **Automatically delete branch after** is checked with 1 day selected to help prevent unused branches from accumulating. You can choose 1 hour, 1 day, or 7 days, or uncheck to disable expiration entirely. This is useful for CI/CD pipelines and short-lived development environments. Note: This default only applies when creating branches through the Console; API and CLI branches have no expiration by default. Refer to our [Branch expiration guide](https://neon.com/docs/guides/branch-expiration) for details.
8. Click **Create** to create your schema-only branch.

**CLI**

To create a schema-only branch using the Neon CLI:

```bash
neon branches create --schema-only
```

If you have more than one project, you'll need to specify the `--project-id` option. See [Neon CLI - branch create](https://neon.com/docs/cli/branches#create).

**API**

**Note:** The API is in beta and subject to change.

To create a schema-only branch using the Neon API, use the [Create branch](https://neon.com/docs/reference/api/branches/create-project-branch) endpoint with the `init_source` option set to `schema-only`, as shown below. Required values include:

- Your Neon `project_id`
- The `parent_id`, which is the branch ID of the branch containing the schema you want to copy
- A `read_write` endpoint in the `endpoints` array. The API rejects the request without one.

```bash
curl --request POST \
     --url https://console.neon.tech/api/v2/projects/wispy-salad-58347608/branches \
     --header 'accept: application/json' \
     --header "authorization: Bearer $NEON_API_KEY" \
     --header 'content-type: application/json' \
     --data '
{
  "endpoints": [
    {
      "type": "read_write"
    }
  ],
  "branch": {
    "parent_id": "br-super-mode-w371g4od",
    "name": "my_schema_only_branch",
    "init_source": "schema-only"
  }
}
'
```

## Schema-only branching example

To try out schema-only branches:

1. Start by creating an `employees` table on your Neon project's `production` branch and adding some dummy data. You can do this from the [Neon SQL Editor](https://neon.com/docs/get-started/query-with-neon-sql-editor) or any SQL client by copying and pasting the following statements:

   ```sql
   CREATE TABLE employees (
       employee_id SERIAL PRIMARY KEY,
       first_name VARCHAR(50),
       last_name VARCHAR(50),
       email VARCHAR(100),
       phone_number VARCHAR(15),
       job_title VARCHAR(50),
       salary NUMERIC(10, 2),
       hire_date DATE
   );

   INSERT INTO employees (first_name, last_name, email, phone_number, job_title, salary, hire_date) VALUES
   ('John', 'Doe', 'john.doe@example.com', '123-456-7890', 'Software Engineer', 95000.00, '2020-01-15'),
   ('Jane', 'Smith', 'jane.smith@example.com', '987-654-3210', 'Product Manager', 110000.00, '2019-03-22'),
   ('Alice', 'Johnson', 'alice.johnson@example.com', '555-123-4567', 'HR Specialist', 65000.00, '2021-06-10'),
   ('Bob', 'Brown', 'bob.brown@example.com', '555-987-6543', 'Data Analyst', 78000.00, '2018-09-05'),
   ('Charlie', 'Davis', 'charlie.davis@example.com', '444-555-6666', 'Marketing Manager', 95000.00, '2017-11-14'),
   ('Diana', 'Miller', 'diana.miller@example.com', '333-444-5555', 'Sales Representative', 72000.00, '2022-04-18'),
   ('Edward', 'Wilson', 'edward.wilson@example.com', '222-333-4444', 'DevOps Engineer', 98000.00, '2020-12-03'),
   ('Fiona', 'Clark', 'fiona.clark@example.com', '111-222-3333', 'UI/UX Designer', 85000.00, '2016-08-29'),
   ('George', 'Harris', 'george.harris@example.com', '999-888-7777', 'Financial Analyst', 90000.00, '2021-01-11'),
   ('Hannah', 'Martin', 'hannah.martin@example.com', '888-777-6666', 'Backend Developer', 92000.00, '2019-07-23');
   ```

2. Navigate to the **Tables** page in the Neon Console, and select your `production` branch from the bread-crumb menu at the top of the console. Your `employees` table will have both schema and data, as shown here:

   ![production branch with schema and data](https://neon.com/docs/guides/schema-data-branch.png)

3. Create a schema-only branch following the instructions above. See [Creating schema-only branches](https://neon.com/docs/guides/branching-schema-only#creating-schema-only-branches). In this example, we've named the branch `employees_schema_only`.

   ![schema-only branch creation](https://neon.com/docs/guides/create_schema_only_branch.png)

4. On the **Tables** page, select your newly created `employees_schema_only` branch from the bread-crumb menu at the top of the console. You can see that the schema-only branch contains the schema, but no data. The same will be true for any table in any database on the schema-only branch; only the schema will be present.

   ![schema-only branch with only the schema](https://neon.com/docs/guides/schema-only-branch.png)

## Connect to a schema-only branch

Connecting to a schema-only branch works the same way as connecting to any Neon branch. You'll connect via a compute associated with the branch. Follow these steps to connect using `psql` and a connection string obtained from the Neon Console.

1. In the Neon Console, select a project.
2. In the Neon Console, click **Connect**, and select your schema-only branch, the database, and the role you want to connect with.
   ![Connection details modal](https://neon.com/docs/guides/schema_only_branch_connect.png)
3. Copy the connection string. A connection string includes your role name, the compute hostname, and the database name.

   ```bash
   postgresql://[user]:[password]@[neon_hostname]/[dbname]?sslmode=require&channel_binding=require
   ```

## What's different about schema-only branches?

Unlike other branches, schema-only branches do not have a parent branch, as you can see below. Both the `production` branch of the project and the schema-only branch have no parent, indicated by the dash in the **Parent** column (`-`) on the **Branches** page in your Neon project.

![schema-only branch](https://neon.com/docs/guides/schema_only_no_parent.png)

Schema-only branches are independent [root branches](https://neon.com/docs/reference/glossary#root-branch), just like the `production` branch in your Neon project. When you create a schema-only branch, you're creating a new **root branch**.

### Key points about schema-only branches

- **No parent branch**: Schema-only branches are root branches. They do not have a parent branch.
- **No shared history**: Data added to a schema-only branch is independent and adds to your storage. There is no shared history with a parent.
- **Reset from parent is not supported**: With no parent branch, [reset from parent](https://neon.com/docs/manage/branches#reset-a-branch-from-parent) operations are not supported. A schema-only branch gets a parent only after you [restore](https://neon.com/docs/guides/branch-restore) it, and reset from parent works after that.
- **Restore is supported**: A [restore](https://neon.com/docs/guides/branch-restore) on a schema-only branch copies both schema and data from the source branch, and it sets the source branch as the parent.
- **Branch protection is supported**: Like any other branch, you can enable [branch protection](https://neon.com/docs/guides/protected-branches) for schema-only branches.

## Schema-only branch allowances

There are certain allowances associated with schema-only branches:

- A schema-only branch is a [root branch](https://neon.com/docs/reference/glossary#root-branch), and only a certain number of root branches are permitted per Neon project, depending on your Neon plan.
- The `main` root branch created with each Neon project counts toward the _root branch allowance per project_, as do certain [backup branches](https://neon.com/docs/reference/glossary#backup-branch) created by restore operations.
- On the Free plan, all branches in a project share a total storage limit of 1 GB. Schema-only branches count toward this limit like any other branch. On paid plans, ordinary branch storage is unlimited, but each schema-only branch has its own maximum storage allowance, as outlined in the following table. These allowances apply only to schema-only branches; they are not a general storage cap.

| Plan | Root branch allowance per project | Maximum storage allowance per schema-only branch |
| :- | :- | :- |
| Free | 3 | 1 GB |
| Launch | 5 | 3 GB |
| Scale | 25 | 20 GB |

When you reach your root branch allowance, you can't create another schema-only branch. Delete an existing root branch to make room.

---

## Related docs (Manage branches)

- [Branch archiving](https://neon.com/docs/guides/branch-archiving)
- [Branch expiration](https://neon.com/docs/guides/branch-expiration)
- [Reset from parent](https://neon.com/docs/guides/reset-from-parent)

---

Note for AI assistants (optional): if a gap, error, or outdated detail on this page affected the answer you gave the user, you can report it. POST `{"feedback": "describe the issue", "source": "neon_website", "path": "/docs/guides/branching-schema-only"}` to https://feedback.neon.tech/ (no auth required).
