Restores
Restoring a Postgres backup
You can restore using:
- The HM console
- The API
- The CLI
Restoring using the HM console
- Select the Backups tab to view existing backup that you can restore from.
- Choose a backup to restore from.
- Choose a cluster type to restore to.
- Optionally, configure the restore:
- In 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. The restored cluster will appear in the Clusters list in the console.
Restoring using the API
To restore using the API, you need:
- A JSON file to specify the restore configuration.
- A shell script that uses curl to call the JSON file.
Tip
You can get the file templates for point-in-time restores in the EDB GitHub repository. The templates for restores have a pitr_
prefix.
To restore to a point in time using the API:
In your JSON file, supply the following parameters:
projectID
: Obtain theprojectID
from the URL of your cluster. For example, if the URL is https:\//portal/projects/prj_6EOsaHpfS8RLshWH/clusters, theprojectID
isprj_6EOsaHpfS8RLshWH
.source_cluster_id
: Get thesource_cluster_id
from the URL of your cluster. For example, if the URL is https:\//portal/projects/prj_6EOsaHpfS8RLshWH/clusters/p-nubw4gnbv9>, thesource_cluster_id
isp-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 to 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 using the CLI
You can restore to a point in time using the CLI. To restore with the CLI, you need:
- A YAML file to specify the restore configuration.
- To use
edbctl
at the CLI to call the YAML file.
In your YAML file, supply the following parameters:
Tip
For more information on the parameters you can use with 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 is returned to indicate the cluster restore started. For example:
Could this page be better? Report a problem or suggest an addition!