Clone or restore Postgres ΒΆ

Clone a Postgres database from its backups, either from the latest available point or from a specific time. The clone is a new, writable database in the same team and environment. It does not change the source database or move your workloads.

Clone the database ΒΆ

Clone from the latest available point, about 10 minutes ago:

bash

To restore to a specific time instead, add --at:

bash

Times without an offset use your computer's local time zone. Use RFC3339 with Z or an explicit offset to specify an absolute time, for example 2026-11-16T12:00:00Z.

Review the configuration and confirm. To override the source's resource or high-availability settings, see the clone flags.

Check progress with:

bash

Wait until Clone status is Completed and Status is Ready.

  1. Open your team in Nais Console and select Postgres.
  2. Select Create Postgres, then the Clone existing database tab.
  3. Select the environment and source database, and enter a name for the new database.
  4. Leave Specify time closed to use the latest available point, about 10 minutes ago. To restore to a specific time, open it and enter a time in your browser's local time zone, within the available recovery window.
  5. Optionally, open Customize resources to change CPU, memory, disk size or high availability. Keep the disk at least as large as the source's.
  6. Select Clone database. Follow the clone status on the new database's page and wait until cloning completes and the database is ready.

If the source has no available recovery window, wait for its backups before trying again. If the default clone point is too early for a newly created source, wait or specify a time within its recovery window.

Do not connect workloads to a failed clone. See Postgres cloning for inherited settings, time limits and completion status.

Inspect the cloned data by connecting as a personal user with the new database's name. This does not affect workload traffic.

Move workloads to the clone ΒΆ

  1. Pause writes from the workloads you want to move.

  2. Change uses.postgres[].name in each workload's manifest to the new database's name:

    app.yaml

    Keep any existing role and envPrefix settings. See Use Postgres in a workload.

  3. Deploy the changed workloads and verify that they connect to the clone and use the expected data.

  4. Resume writes when verification is complete.

Do not delete the source database until cloning has completed, you have verified the data and no workloads still use it.