Re: Backup setup

From: Alan Hodgson <ahodgson(at)simkin(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Backup setup
Date: 2008-04-23 15:38:05
Message-ID: 200804230838.05965@hal.medialogik.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday 23 April 2008, "Gabor Siklos" <gabor(at)karamaan(dot)com> wrote:
> I need to back up our database off-site for disaster recovery. If I just
> back up the entire database data directory (i.e. /var/lib/pgsql/data)
> will I be able to restore from there?

Technically you can do this, if you do it per the PITR instructions in the
manual (ie. you also need all the WAL logs produced during and around the
backup window).

> Or should I instead just dump the
> data, using pg_dump, and back up the dump?

This is easier to restore from.

> The advantage of the first method would be that I would not have to wait
> for pg_dump (it takes quite long on our 60G+ database) and would just be
> able to configure the backup agent to monitor the data directory and do
> differential backups of the files there every hour or so.

Differential backups of a running database will produce garbage. The proper
way to keep running backups of the database is through the PITR mechanism.

Very few applications that write to disk can be safely backed up while
running. You might want to look at your whole backup strategy to see if
you're really backing up what you think you're backing up.

--
Alan

In response to

Browse pgsql-general by date

  From Date Subject
Next Message wstrzalka 2008-04-23 15:39:59 Re: plpgsql and logical expression evaluation
Previous Message Christophe 2008-04-23 15:35:08 Re: Backup setup