---
search:
  tags:
    - databases
    - POST
seo:
  description: >-
    Makes a new database, as POST /v1/databases does (the same quota,… Reference
    for the POST /v1/databases/{database}/duplicate endpoint in the pols.so API.
sidebar:
  label: Make a new database as a copy of a database now
  badge: POST
title: Make a new database as a copy of a database now
type: openapi-operation
---
Makes a new database, as `POST /v1/databases` does (the same quota,
trial, credit and billing), and copies the source's data into it as
it is now: once its PostgreSQL is set up, `pg_dump` in the source's
sandbox streams into `pg_restore` in the new one's. The source stays
as it is and serves meanwhile; the copy is consistent as of the
dump's start. The new database stays `provisioning` until the copy
is done, and fails with the reason (`error`) if it fails; a copy cut
short by a restart of pols starts again. Its objects are owned by
its own role `app`, which gets a new password of its own, never the
source's; no site is linked to it.

Only a ready source (409 otherwise). `size` defaults to the
source's; a size whose disk is smaller than the source's data
answers 409 with both sizes.

`POST /v1/databases/{database}/duplicate`
