Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
postgresql_backup_recovery_physical [2020/01/22 14:33] – andonovj | postgresql_backup_recovery_physical [2020/01/27 17:45] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 116: | Line 116: | ||
- | =====Restore & Recovery===== | + | ===== Restore & Recovery ===== |
Restore and Recovery have been ALWAYS a different topics in the eyes of a DBA: | Restore and Recovery have been ALWAYS a different topics in the eyes of a DBA: | ||
Line 123: | Line 123: | ||
====Restore==== | ====Restore==== | ||
- | Restore of pg_basebackup is done by copying the content of the backup in the data folder. That's all. Pg_basebackup performs consistent backup and as such it is enough just to copy the content on empty data dir: | + | Restore of pg_basebackup is done by copying the content of the backup in the data folder. That's all. Pg_basebackup performs consistent backup and as such it is enough just to copy the content on empty data dir. Please be sure to keep the OLD WAL files prior any deletion. They are extremely important. |
<sxh bash> | <sxh bash> | ||
Line 132: | Line 132: | ||
</ | </ | ||
- | ====Whole Server==== | + | |
+ | ====Recovery==== | ||
+ | Manual recovery is done by creating recovery.conf file, for example: | ||
+ | <sxh bash> | ||
+ | restore_command = 'cp barman_xlog/ | ||
+ | recovery_end_command = 'rm -fr barman_xlog' | ||
+ | recovery_target_time = ' | ||
+ | </ | ||
+ | |||
+ | And restart the service: | ||
+ | |||
+ | <sxh bash> | ||
+ | -bash-4.2$ / | ||
+ | waiting for server to start....2020-01-22 09: | ||
+ | 2020-01-22 09: | ||
+ | 2020-01-22 09: | ||
+ | 2020-01-22 09: | ||
+ | 2020-01-22 09: | ||
+ | 2020-01-22 09: | ||
+ | </ | ||
+ | |||
+ | Alternatively, | ||
+ | |||
+ | ====Using Barman==== | ||
With Barman we can easily restore your server, if you have one :). Please ensure that **YOU NEVER RESTORE IN YOUR ORIGINAL DATA DIRECTORY**, | With Barman we can easily restore your server, if you have one :). Please ensure that **YOU NEVER RESTORE IN YOUR ORIGINAL DATA DIRECTORY**, | ||