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

# clone

> Copy model relations between configured targets.

# sqb clone

Copies model relations from one target to another. It uses adapter-native cloning where supported and physical copies where required; `--hard-copy` forces a physical copy on adapters that support both.

No `manifest.json` generation or artifact management is required. Clone works directly against live targets.

## Usage

```bash theme={null}
sqb --project-dir <path> clone --from <target> --to <target> [flags]
```

## Flags

| Flag                  | Description                                              |
| --------------------- | -------------------------------------------------------- |
| `--from`              | Source target (required)                                 |
| `--to`                | Destination target (required)                            |
| `--hard-copy`         | Force physical table copies instead of zero-copy cloning |
| `--no-sql-validation` | Skip compile-time SQL syntax validation                  |
| `--select`, `-s`      | Select specific models to clone                          |
| `--exclude`           | Exclude specific models from cloning                     |

## Examples

```bash theme={null}
# Clone all models from prod to dev
sqb clone --from prod --to dev

# Clone only marts to dev
sqb clone --from prod --to dev --select path:models/marts

# Force physical copies
sqb clone --from prod --to dev --hard-copy
```

## Clone policies

Targets deny cloning by default. Enable the origin and destination explicitly in `sqlbuild_project.toml`:

```toml theme={null}
[targets.prod.clone]
allow_as_clone_origin = true

[targets.dev.clone]
allow_as_clone_destination = true
```

The origin target must already contain the built relations being cloned. The configured warehouse credentials must be able to read those relations and create relations in the destination. See [Project Configuration](/concepts/project-configuration) for details.
