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

# api.cloneDatabase()

> Public low-code contract, signatures and examples for api.cloneDatabase.

## `api.cloneDatabase()`

Clones a logical database by name.

Notes:

* Unavailable with `readOnly: true` (throws an error).
* By default waits for the clone and returns cloned database metadata.
* Set `&#123; async: true &#125;` to start a backend clone task and return immediately with an accepted response.
* Omit `name` to use the backend default source-name plus `_Clone`.

### Signature

```ts theme={null}
static cloneDatabase<TAsync extends boolean = false>(
      name: string,
      options?: DatabaseCloneInput & { async?: TAsync },
    ): Promise<
      TAsync extends true
        ? CloneDatabaseAcceptedResponse
        : TAsync extends false
          ? CloneDatabaseCompletedResponse
          : CloneDatabaseResponse
    >;
```

### Example

```ts theme={null}
const result = await api.cloneDatabase('customers', {
  includeItems: false,
  includePartitions: true,
});

return result.databases;
```

See [all api methods](https://docs.revoengine.com/low-code/reference/api.md) or [runtime basics](https://docs.revoengine.com/low-code/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.