You can prepare a database of DB instances to restore in case of a failure. You can perform backups from the console whenever needed or you can set to perform periodical backup. During the backup, the storage performance of that DB instance might degrade. It is recommended to back up during off-peak hours to avoid impacting your services.
RDS for PostgreSQL uses the pg_basebackup tool to back up databases. To restore to a backup of an external PostgreSQL or to a backup of RDS for PostgreSQL, you must use the same version of pg_basebackup used by RDS for PostgreSQL. pg_basebackup version according to the DB engine version is as follows.
PostgreSQL version | pg_basebackup version |
---|---|
14.6 | 14.6 |
The following settings are applied to backup and it applies to both auto and manual backups.
If you want to permanently store a database at a specific point in time, you can perform a backup manually from the console. Unlike auto backups, manual backups are not deleted when a DB instance is deleted unless you explicitly delete the backup. To perform a manual backup from the console
❶ After selecting the DB instance to back up, click Backup, and Create Backup and the pop-up window appears. - If you click Backup without selecting DB instance, you can select DB instance from the drop-down menu within the Create Backup pop-up window. ❷ Enter a name of the backup. There are the following restrictions.
Or, on the Backup tab,
❶ Click + Create Backup and the Create Backup pop-up window will appear. ❷ Select the DB instance on which to perform the backup. ❸ You can enter a name for the backup and click Create to request backup creation.
Even when performing manual backups, auto backups can be performed if necessary for restore jobs or depending on the auto backup schedule. If you set the backup retention period for DB instance to 1 day or longer, auto backups are activated, and backups are performed at the specified time. auto backups have the same life cycle as DB instances. When a DB instance is deleted, all archived auto backups are deleted. The settings that Auto Backup supports are as follows.
Backup Retention Period
Backup Retry Count
Backup Execution Time
Auto backup name is given in the format of {DB instance name} yyyy-MM-dd-HH-mm
.
[Caution] Backups may not be performed in situations such as previous backups not ending.
All backup files are uploaded to the internal backup storage and saved. For manual backups, they are permanently stored until they are deleted separately and backup storage charges are incurred depending on the backup capacity. Auto backups are stored for the retention period you set, and you are charged for the portion of the total size of the auto backup file that exceeds the storage size of your DB instance. You cannot directly access the internal backup storage where the backup files are stored.
You can use backup to restore data to any point in time. Restoration always creates a new DB instance and restoration cannot be performed on an existing DB instance. You can only restore to the same DB engine version as the original DB instance from which you performed the backup. It supports Snapshot Restore, which restores to the point in time when the backup was created, and Point-in-Time Restore, which restores to a specific point in time that you want.
[Caution] The restoration might fail if the data storage size of the DB instance you want to restore is smaller than that of the original DB instance from which you performed the backup or if you use a parameter group different from the parameter group of the original DB instance.
You do not need the original DB instance that performed the backup by restoring only the backup file. To restore a snapshot from the console
❶ Select the backup file you want to restore on the details tab of the dB instance, and then click Snapshot Restore to go to the Restore DB instance screen.
Or
❶ On the Backup tab, select the backup file you want to restore and then click Snapshot Restore.
You can use point-in-time restoration to restore to a specific point-in-time or specific LSN in the WAL log. To restore a point in time, you need a backup file and a WAL log from the time you performed the backup to the time you want to restore it. WAL logs are stored in the storage of the original DB instance where the backup takes place. Short WAL log retention periods allow more storage capacity, but recovery to the desired point in time can be challenging. For the case listed below, you might not be able to restore to the desired point in time because you do not have the WAL log required for point in time restoration.
To restore a point in time from the console
❶ Select the DB instance you want to restore to a point in time and click Point In Time Restore to go to the page where you can set up a point in time restore.
When restoring with Timestamp, perform the restore based on the backup file closest to the selected time point and apply the WAL log to the desired time point.
❶ Select a restore method.
❷ Select a time to restore. You can restore it to the most recent point in time, or enter the specific point in time that you want.