Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UahiP-00075r-V1 for pgsql-admin@arkaria.postgresql.org; Fri, 10 May 2013 07:26:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UahiO-0001Mr-No for pgsql-admin@arkaria.postgresql.org; Fri, 10 May 2013 07:26:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UahiN-0001MP-KV for pgsql-admin@postgresql.org; Fri, 10 May 2013 07:26:03 +0000 Received: from a10.virtuaal.com ([195.222.15.97]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UahiJ-0001By-68 for pgsql-admin@postgresql.org; Fri, 10 May 2013 07:26:03 +0000 Received: from [195.222.11.180] (port=49336 helo=[10.0.1.201]) by a10.virtuaal.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80) (envelope-from ) id 1UahiG-003nDW-G6 for pgsql-admin@postgresql.org; Fri, 10 May 2013 10:25:56 +0300 Message-ID: <518CA0F9.7020600@okservers.eu> Date: Fri, 10 May 2013 10:25:45 +0300 From: Viktor User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: "pgsql-admin@postgresql.org" Subject: Re: Point in time recovery + replication References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------050000020306030902020304" X-Virtuaalcom-MailScanner-Information: Please contact the ISP for more information X-Virtuaalcom-MailScanner-ID: 1UahiG-003nDW-G6 X-Virtuaalcom-MailScanner: Not scanned: please contact your Internet E-Mail Service Provider for details X-Virtuaalcom-MailScanner-SpamCheck: X-Virtuaalcom-MailScanner-From: viktor@okservers.eu X-Spam-Status: No X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - a10.virtuaal.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - okservers.eu X-Get-Message-Sender-Via: a10.virtuaal.com: authenticated_id: viktor@okservers.eu X-Source: X-Source-Args: X-Source-Dir: X-Pg-Spam-Score: -0.0 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org This is a multi-part message in MIME format. --------------050000020306030902020304 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hei, I think, that it can be done just via RSYNC with stopped both of databases: http://www.debian-administration.org/article/How_to_setup_Postgresql_9.1_Streaming_Replication_Debian_Squeeze Just like in the "*Getting it working*" part. On 5/9/2013 6:45 PM, German Becker wrote: > Hello Everyone, > > I have a primary / hot standby scenario with streaming replication. > Postgres version is 9.1.8. > > A full backup is made nightly on the primary and copied to the > secondary, just for backup purposes, the replication is never stopped > /restarted. > > Supose that for a reason I need to restore the primary to a point in > time, let's say just after the last backup. I've done this by: > > 1) stoping de databese > 2)restoring the backup > 3) creatng a recovery.conf where I specified a recovery_target accordingly > 4) start the database > > This works fine on the primary. The quesion is how do I restart the > replication on the secondary, on the new timeline? > > I tried to restore the same backup on the secondary and starting > the continuous recovery, but it starts on the previous timeline. > I also tried to set the recovery_target_timeline in the secondary to > the new timeline, but I get an error. Do I need to get a new copy of > the primary to continue the replication? --------------050000020306030902020304 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
Hei,

I think, that it can be done just via RSYNC with stopped both of databases:

http://www.debian-administration.org/article/How_to_setup_Postgresql_9.1_Streaming_Replication_Debian_Squeeze

Just like in the "Getting it working" part.


On 5/9/2013 6:45 PM, German Becker wrote:
Hello Everyone,

I have a primary  / hot standby scenario with streaming replication. Postgres version is 9.1.8. 

A full backup is made nightly on the primary and copied to the secondary, just for backup purposes, the replication is never stopped /restarted.

Supose that for a reason I need to restore the primary to a point in time, let's say just after the last backup. I've done this by:

1) stoping de databese
2)restoring the backup
3) creatng a recovery.conf where I specified a recovery_target accordingly
4) start the database

This works fine on the primary. The quesion is how do I restart the replication on the secondary, on the new timeline?

I tried to restore the same backup on the secondary and starting the continuous recovery, but it starts on the previous timeline.
I also tried to set the recovery_target_timeline in the secondary to the new timeline, but I get an error. Do I need to get a new copy of the primary to continue the replication?

--------------050000020306030902020304--