Thread: Moving data directory from one server to another

Moving data directory from one server to another

From
Ehsan Haq
Date:
Hi,
   I have two Linux servers both having same Hardware architecture one have ES5 and the other having ES4. Both the servers have same version of PostGres installed (8.3). I want to move all my DBs from ES5 server to ES4 server. I have tried the pg_dump but there are a lot of encoding problems, so can I copy the whole data directory from ES5 server to ES4 server when the PostGres server is not running? Will it be safe?

Thanks
Ehsan

Re: Moving data directory from one server to another

From
Ehsan Haq
Date:
Hi Yar,
   Thanks for the reply. I gave it a try, but found that there was a slight problem as the directory path of PostGres on the two servers were different. Thats why my test failed. If you have any ideas about how to overcome this (which configuration files are required to be changed). Please let me know.
 
Thanks
Ehsan

--- On Mon, 3/29/10, Yar Tykhiy <yar@barnet.com.au> wrote:

From: Yar Tykhiy <yar@barnet.com.au>
Subject: Re: [GENERAL] Moving data directory from one server to another
To: "Ehsan Haq" <ehsan_haq98@yahoo.com>
Date: Monday, March 29, 2010, 1:01 AM

Hi Ehsan,

On Fri, Mar 26, 2010 at 11:25:56AM -0700, Ehsan Haq wrote:
> Hi,
>    I have two Linux servers both having same Hardware architecture one have ES5 and the other having ES4. Both the servers have same version of PostGres installed (8.3). I want to move all my DBs from ES5 server to ES4 server. I have tried the pg_dump but there are a lot of encoding problems, so can I copy the whole data directory from ES5 server to ES4 server when the PostGres server is not running? Will it be safe?

Apart from my having no idea what ES4 or ES5 is, my experience with
moving a pgsql data directory across machines has been very positive as
long as the machine architecture and Postgresql version are the same. Of
course, doing a test run before actually switching everything over will
be a very good idea.

Yar