My pgdata is on a secondary drive /Data that is failing. The drive been complaining about 1 currently unreadable pending sectors
My Backups has been run using a script. I read the article from postgresql.org regarding continuous archiving PITR and have been doing a file level backup along with wallarchving ever since.
Each Saturday night I do a select pg_start_backup('label');
my script tars the entire pgdata directory which then copies said directory to another file server using SCP. so I have 2 copies just in case something like this happens. However my /Data drive is still functional for now.
So I also SCP'd my last good wall archive backup to another server as well.
So I have good backups I would think however I have never tested this. I really don't have another server to test on anyway.
My plan is to get another drive, stop the postgres service from running, unmount my failing /Data drive where the postgres data directory resides, install the new drive, then untar my file level backup containing the /Data/pgdata directory, change the ownership on the file level backup of the pgdata directory from root back to postgres as well as any archive files.
After that I am clueless however will be researching this.
for wallarchives I keep all files numbered after the wallarchive.backup file name and place them in a dated directory. I delete the old ones as the only one I need is the current. Actually I do keep a few weeks.
Again, postgres was installed on my server but I put the pgdata directory containing pg_xlog etc on my failing secondary /Data drive: /Data/postgres/pgdata/ Also that is where the wallarchives are: /Data/Backups/postgres/wallarchives
Is my logic or steps to do this correct?
Do I just copy the wall archives to some directory and run a command?
pg_xlog - do I really need to be concerned with what just got place in here? If I am going back a week in my wall archives I wouldn't need what just got placed in the pg_xlog right? (this is not a large company or anything so I sometimes don't even have any changes within a week anyway)
Also I believe I in the /etc/rc.d/init.d I changed my link from /var/lib to PGDATA=/Data/postgres/pgdata. I won't need to do anything with this since its on the primary OS drive right? All I should have to do is the restore of the file level and then copy the wall archives to some directory?
Again I am going to research but due to the sensitivity of this I think I need some help thanks and I appreciate your time.