Restores
Restoring a Postgres backup
You can use any of the following options to perform a restore:
- The PGAIHM web UI
- The API
- The CLI
Use the following steps to restore a Postgres cluster:
Restoring from the PGAIHM web UI cluster restore feature
- Select the Backups tab to view existing backup that you can restore from. The following fields are available:
Name | Description |
---|---|
Status | The current status of the backup. |
Name | The name of the backup. |
Start Time | The time the backup started. |
Stop Time | The time the backup stopped. |
Duration | The amount of time it took to complete the backup. |
Location | The location of the backup. |
Method | The method by which the backup was taken. |
- Choose a backup to restore from.
- Choose a cluster type to restore to.
- [Optional] Select Restore Cluster for a full restore without changing any configuration.
- In the Cluster Settings, provide a unique name for the restored cluster.
- For Restore Type, choose Fully Restore or Point In Time Restore. If you choose Point In Time Restore, use the date picker to select a point in time to restore to.
- For DB Configuration, and Additional Settings, select your preferred database configuration.
- Select Restore Cluster once you're ready to restore the cluster from a backup. The restored cluster will appear in the Clusters list in the console.
Restoring from the API
To restore with the API, the following are required:
- A JSON file to specify the restore configuration.
- A shell script that uses curl to call the JSON file.
Tip
You can obtain the file templates for point in time restores in the EDB GitHub repository. The templates for restores are named pitr_
.
Use the following steps to restore to a point in time using the API.
- In your JSON file, supply the following parameters:
projectID
: Obtain the projectID
from the URL of your cluster. For example, if the URL is https://portal/projects/prj_6EOsaHpfS8RLshWH/clusters, the projectID
is prj_6EOsaHpfS8RLshWH.
source_cluster_id
: Obtain the source_cluster_id
from the URL of your cluster. For example, if the URL is https://portal/projects/prj_6EOsaHpfS8RLshWH/clusters/p-nubw4gnbv9, the source_cluster_id
is p-nubw4gnbv9.
point_in_time
: Provide a timestamp value for the point in time that you want to restore the cluster to.
Supply additional information for the other configuration parameters as appropriate for the cluster you want to restore. For example:
Create a shell script that will call the JSON file. For example:
Execute the shell script. If the script returns a clusterID as output, the restored cluster will appear in the Clusters list in the console. For example:
Restoring from the CLI
Use the following steps to restore to a point in time using the CLI.
To restore with the CLI, the following are required:
- A YAML file to specify the restore configuration.
- Use of
edbctl
at the CLI to call the YAML file.
- In your YAML file, supply the following parameters:
Note
For more information on the expected parameters when using the restore command, use edbctl cluster restore -h
in the CLI to view the help file.
- Execute the CLI command by pointing it to your YAML file. A message will be returned to indicate the cluster restore has started. For example:
Could this page be better? Report a problem or suggest an addition!