Starting new cluster from base backup

From: Guillaume Drolet <droletguillaume(at)gmail(dot)com>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Starting new cluster from base backup
Date: 2015-02-16 19:31:41
Message-ID: CAOkiyv7PwejfhhtrHxT+TRu-jL+0h7kjvRAF0t2qnwHwGFdpbQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear listers,

I want to move a cluster from one machine to another. I used pg_basebackup
to create an archive and copied/extracted it over the old PGDATA location
on the new machine (the server was stopped). If I start pgsql I get these
messages in my log file:

2015-02-16 14:29:12 EST LOG: database system was interrupted; last known
up at 2015-02-07 06:31:41 EST
2015-02-16 14:29:12 EST LOG: invalid checkpoint record
2015-02-16 14:29:12 EST FATAL: could not locate required checkpoint record
2015-02-16 14:29:12 EST HINT: If you are not restoring from a backup, try
removing the file "E:/data/backup_label".
2015-02-16 14:29:12 EST LOG: startup process (PID 3148) exited with exit
code 1
2015-02-16 14:29:12 EST LOG: aborting startup due to startup process
failure

I assume this is due to the fact the pg_xlog folder is empty (this is how
pg_basebackup makes it in the archive) and that I haven't supplied a
recovery.conf file with the restore restore_command = 'copy
"E:\\archivedir\\%f" "%p"', and the archived WAL files.

Now my question is: it this a correct way of moving a cluster between
machines?

If yes, what WAL files will I put in pg_xlog? Would I have needed to copy
those that were in the old machine right after the base backup?

If this is not the right way to do it, what is the best way?

Thanks a lot for your help,

Guillaume

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-02-16 20:21:02 Re: Starting new cluster from base backup
Previous Message Francisco Olarte 2015-02-16 13:01:51 Re: Import large data set into a table and resolve duplicates?