cancel
Showing results for 
Search instead for 
Did you mean: 

Bart timeline restoration

Highlighted
Level 2 Adventurer

Bart timeline restoration

I can not find documentation on restoring with a timelineid. When using Bart 1.1.1.1 how do you use the timelineid option? Is it just the timelineid switch or can I combine it with the physical time switch and/or transactionid switch for my PITR.
3 REPLIES 3
Community Manager

Re: Bart timeline restoration

Hello,

 

BART's 'RESTORE' command has a '-t' switch which can be used to specify timeline_id.

Please reffer to section 5.4.7 of the BART documentaion at the following link:

https://www.enterprisedb.com/docs/en/1.1/bart/EDB_Postgres_Backup_and_Recovery_Guide.1.20.html#pID0E...

Hope this is what you are looking for.

Level 2 Adventurer

Re: Bart timeline restoration

It is not what I'm looking for. To directly reference the link you provided, it says Bart will accept invalid options for -t, -x, -g. I am specifically asking for the definitions of "validity". How do you use these options ? Can I use -t and -g together ? What are the options that I can use in conjunction with -t such that I can successfully restore a specific timeline ? And what files are needed for this to happen? Do I need a 00002.history file to restore to a timeline-Id of 2??

Bart is clear. But the Postgres documentation on timeline _id recovery is sparse, vague, and lacking. I'm asking for someone to rectify that.
Level 2 Adventurer

Re: Bart timeline restoration

Bart uses the --target-xid, --target-tli, and --target-timestamp arguments to construct a recovery.conf file.

 

When the database server starts (after the restore operation completes), the server reads the recovery.conf file and replays the required WAL (write-ahead LOG) files, stopping at the specified point (if you've specified a --target-xid or --target-timestamp).

 

You can learn more about the recovery.conf file here: https://www.postgresql.org/docs/9.6/static/recovery-target-settings.html.

 

When you invoke bart with the --target-xid option, bart writes a recovery_target_xid to the recovery.conf file.

When you invoke bart with the --target-tli option, bart writes a recovery_target_timeline to the recovery.conf file.

When you invoke bart with the --target-timestamp option, bart writes a recovery_target_time to the recovery.conf file.

 

Here are a few articles/blogs that you may find helpful:

 

timelines and history files PostgreSQL 9.1 (dba.stackexchange.com)

Evolution of Fault Tolerance in PostgreSQL: Time Travel (2nd Quadrant)

 

 Hope that helps.