Обсуждение: Moving the data directory

Поиск
Список
Период
Сортировка

Moving the data directory

От
Sairam Krishnamurthy
Дата:
All,

I am using Ubuntu 10.04 and Postgres 8.4, I have been trying to move
my data dir to another device for the past couple of days but ran into
a lot of problems.

I did the following:

1. Copy the contents of /var/lib/postgresql/8.4/main to my folder.
2. Changed the data_directory in postgresql.conf.

When I start postgres using /etc/init.d script I get the following error,

* Starting PostgreSQL 8.4 database server
 * Error: could not exec /usr/lib/postgresql/8.4/bin/pg_ctl
/usr/lib/postgresql/8.4/bin/pg_ctl start -D
/media/extension/var/lib/postgresql/8.4/main/ -l
/var/log/postgresql/postgresql-8.4-main.log -s -o  -c
config_file="/etc/postgresql/8.4/main/postgresql.conf" :


I tried changing the ownership of the
/media/extension/var/lib/postgresql dir to <myusername>, postgres and
root. Now of them worked and I keep getting the same error message.

I found a lot of similar problems online but none had a solution.

Can someone help me with this?

TIA

Thanks,
Sairam Krishnamurthy
+1 612 859 8161

Re: Moving the data directory

От
Scott Mead
Дата:

On Tue, Feb 15, 2011 at 4:41 PM, Sairam Krishnamurthy <kmsram420@gmail.com> wrote:
All,

I am using Ubuntu 10.04 and Postgres 8.4, I have been trying to move
my data dir to another device for the past couple of days but ran into
a lot of problems.

I did the following:

1. Copy the contents of /var/lib/postgresql/8.4/main to my folder.
2. Changed the data_directory in postgresql.conf.

When I start postgres using /etc/init.d script I get the following error,

* Starting PostgreSQL 8.4 database server
 * Error: could not exec /usr/lib/postgresql/8.4/bin/pg_ctl
/usr/lib/postgresql/8.4/bin/pg_ctl start -D
/media/extension/var/lib/postgresql/8.4/main/ -l
/var/log/postgresql/postgresql-8.4-main.log -s -o  -c
config_file="/etc/postgresql/8.4/main/postgresql.conf" :


I tried changing the ownership of the
/media/extension/var/lib/postgresql dir to <myusername>, postgres and
root. Now of them worked and I keep getting the same error message.

I found a lot of similar problems online but none had a solution.

Can someone help me with this?

Do you have any useful information in the logs?

/var/log/postgresql/postgresql-8.4-main.log

--Scott


 

TIA

Thanks,
Sairam Krishnamurthy
+1 612 859 8161

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: Moving the data directory

От
Sairam Krishnamurthy
Дата:
None. The log is empty.


Thanks,
Sairam Krishnamurthy
+1 612 859 8161



On Tue, Feb 15, 2011 at 3:45 PM, Scott Mead <scottm@openscg.com> wrote:
>
> On Tue, Feb 15, 2011 at 4:41 PM, Sairam Krishnamurthy <kmsram420@gmail.com>
> wrote:
>>
>> All,
>>
>> I am using Ubuntu 10.04 and Postgres 8.4, I have been trying to move
>> my data dir to another device for the past couple of days but ran into
>> a lot of problems.
>>
>> I did the following:
>>
>> 1. Copy the contents of /var/lib/postgresql/8.4/main to my folder.
>> 2. Changed the data_directory in postgresql.conf.
>>
>> When I start postgres using /etc/init.d script I get the following error,
>>
>> * Starting PostgreSQL 8.4 database server
>>  * Error: could not exec /usr/lib/postgresql/8.4/bin/pg_ctl
>> /usr/lib/postgresql/8.4/bin/pg_ctl start -D
>> /media/extension/var/lib/postgresql/8.4/main/ -l
>> /var/log/postgresql/postgresql-8.4-main.log -s -o  -c
>> config_file="/etc/postgresql/8.4/main/postgresql.conf" :
>>
>>
>> I tried changing the ownership of the
>> /media/extension/var/lib/postgresql dir to <myusername>, postgres and
>> root. Now of them worked and I keep getting the same error message.
>>
>> I found a lot of similar problems online but none had a solution.
>>
>> Can someone help me with this?
>
> Do you have any useful information in the logs?
>
> /var/log/postgresql/postgresql-8.4-main.log
>
> --Scott
>
>
>
>>
>> TIA
>>
>> Thanks,
>> Sairam Krishnamurthy
>> +1 612 859 8161
>>
>> --
>> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-admin
>
>

Re: Moving the data directory

От
Frederiko Costa
Дата:
I would recommend to create the data area in the destination pgsql
server and dump the source database into it, rather than copying the
data directory.

On Tue, Feb 15, 2011 at 1:41 PM, Sairam Krishnamurthy
<kmsram420@gmail.com> wrote:
> All,
>
> I am using Ubuntu 10.04 and Postgres 8.4, I have been trying to move
> my data dir to another device for the past couple of days but ran into
> a lot of problems.
>
> I did the following:
>
> 1. Copy the contents of /var/lib/postgresql/8.4/main to my folder.
> 2. Changed the data_directory in postgresql.conf.
>
> When I start postgres using /etc/init.d script I get the following error,
>
> * Starting PostgreSQL 8.4 database server
>  * Error: could not exec /usr/lib/postgresql/8.4/bin/pg_ctl
> /usr/lib/postgresql/8.4/bin/pg_ctl start -D
> /media/extension/var/lib/postgresql/8.4/main/ -l
> /var/log/postgresql/postgresql-8.4-main.log -s -o  -c
> config_file="/etc/postgresql/8.4/main/postgresql.conf" :
>
>
> I tried changing the ownership of the
> /media/extension/var/lib/postgresql dir to <myusername>, postgres and
> root. Now of them worked and I keep getting the same error message.
>
> I found a lot of similar problems online but none had a solution.
>
> Can someone help me with this?
>
> TIA
>
> Thanks,
> Sairam Krishnamurthy
> +1 612 859 8161
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

Re: Moving the data directory

От
Sairam Krishnamurthy
Дата:
Can you explain a bit? I dint get what you mean data area.

Thanks,
Sairam Krishnamurthy
+1 612 859 8161

On 02/15/2011 04:09 PM, Frederiko Costa wrote:
I would recommend to create the data area in the destination pgsql
server and dump the source database into it, rather than copying the
data directory.

On Tue, Feb 15, 2011 at 1:41 PM, Sairam Krishnamurthy
<kmsram420@gmail.com> wrote:
All,

I am using Ubuntu 10.04 and Postgres 8.4, I have been trying to move
my data dir to another device for the past couple of days but ran into
a lot of problems.

I did the following:

1. Copy the contents of /var/lib/postgresql/8.4/main to my folder.
2. Changed the data_directory in postgresql.conf.

When I start postgres using /etc/init.d script I get the following error,

* Starting PostgreSQL 8.4 database server
 * Error: could not exec /usr/lib/postgresql/8.4/bin/pg_ctl
/usr/lib/postgresql/8.4/bin/pg_ctl start -D
/media/extension/var/lib/postgresql/8.4/main/ -l
/var/log/postgresql/postgresql-8.4-main.log -s -o  -c
config_file="/etc/postgresql/8.4/main/postgresql.conf" :


I tried changing the ownership of the
/media/extension/var/lib/postgresql dir to <myusername>, postgres and
root. Now of them worked and I keep getting the same error message.

I found a lot of similar problems online but none had a solution.

Can someone help me with this?

TIA

Thanks,
Sairam Krishnamurthy
+1 612 859 8161

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: Moving the data directory

От
Scott Mead
Дата:


On Tue, Feb 15, 2011 at 4:58 PM, Sairam Krishnamurthy <kmsram420@gmail.com> wrote:
None. The log is empty.

Can you manually start the database as the postgres user:

/usr/lib/postgresql/8.4/bin/pg_ctl start -D /media/extension/var/lib/postgresql/8.4/main/ -o config_file="/etc/postgresql/8.4/main/postgresql.conf"
 

--Scott




Thanks,
Sairam Krishnamurthy
+1 612 859 8161



On Tue, Feb 15, 2011 at 3:45 PM, Scott Mead <scottm@openscg.com> wrote:
>
> On Tue, Feb 15, 2011 at 4:41 PM, Sairam Krishnamurthy <kmsram420@gmail.com>
> wrote:
>>
>> All,
>>
>> I am using Ubuntu 10.04 and Postgres 8.4, I have been trying to move
>> my data dir to another device for the past couple of days but ran into
>> a lot of problems.
>>
>> I did the following:
>>
>> 1. Copy the contents of /var/lib/postgresql/8.4/main to my folder.
>> 2. Changed the data_directory in postgresql.conf.
>>
>> When I start postgres using /etc/init.d script I get the following error,
>>
>> * Starting PostgreSQL 8.4 database server
>>  * Error: could not exec /usr/lib/postgresql/8.4/bin/pg_ctl
>> /usr/lib/postgresql/8.4/bin/pg_ctl start -D
>> /media/extension/var/lib/postgresql/8.4/main/ -l
>> /var/log/postgresql/postgresql-8.4-main.log -s -o  -c
>> config_file="/etc/postgresql/8.4/main/postgresql.conf" :
>>
>>
>> I tried changing the ownership of the
>> /media/extension/var/lib/postgresql dir to <myusername>, postgres and
>> root. Now of them worked and I keep getting the same error message.
>>
>> I found a lot of similar problems online but none had a solution.
>>
>> Can someone help me with this?
>
> Do you have any useful information in the logs?
>
> /var/log/postgresql/postgresql-8.4-main.log
>
> --Scott
>
>
>
>>
>> TIA
>>
>> Thanks,
>> Sairam Krishnamurthy
>> +1 612 859 8161
>>
>> --
>> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-admin
>
>

Re: Moving the data directory

От
Sairam Krishnamurthy
Дата:
Scott,

I get this error.

server starting
krishnam@nipa-umh:/media/extension/var/lib$ postgres: invalid argument: "config_file=/etc/postgresql/8.4/main/postgresql.conf"

tried with both -o and -c arguments.
Thanks,
Sairam Krishnamurthy
+1 612 859 8161

On 02/15/2011 04:27 PM, Scott Mead wrote:
/usr/lib/postgresql/8.4/bin/pg_ctl start -D /media/extension/var/lib/postgresql/8.4/main/ -o config_file="/etc/postgresql/8.4/main/postgresql.conf

Re: Moving the data directory

От
Scott Mead
Дата:


On Tue, Feb 15, 2011 at 5:32 PM, Sairam Krishnamurthy <kmsram420@gmail.com> wrote:
Scott,

I get this error.

server starting
krishnam@nipa-umh:/media/extension/var/lib$ postgres: invalid argument: "config_file=/etc/postgresql/8.4/main/postgresql.conf"

tried with both -o and -c arguments.

My mistake, I screwed up!

/usr/lib/postgresql/8.4/bin/pg_ctl start -D /media/extension/var/lib/postgresql/8.4/main/ -o "-c config_file="/etc/postgresql/8.4/main/postgresql.conf"

 (-c inside the quotes)

--Scott

Thanks,
Sairam Krishnamurthy
+1 612 859 8161

On 02/15/2011 04:27 PM, Scott Mead wrote:
/usr/lib/postgresql/8.4/bin/pg_ctl start -D /media/extension/var/lib/postgresql/8.4/main/ -o config_file="/etc/postgresql/8.4/main/postgresql.conf

Re: Moving the data directory

От
Sairam Krishnamurthy
Дата:
Again,

pg_ctl: could not open PID file "/media/extension/var/lib/postgresql/8.4/main/postmaster.pid": Permission denied

Tried all the different ownership possible.

Thanks,
Sairam Krishnamurthy
+1 612 859 8161

On 02/15/2011 04:37 PM, Scott Mead wrote:


On Tue, Feb 15, 2011 at 5:32 PM, Sairam Krishnamurthy <kmsram420@gmail.com> wrote:
Scott,

I get this error.

server starting
krishnam@nipa-umh:/media/extension/var/lib$ postgres: invalid argument: "config_file=/etc/postgresql/8.4/main/postgresql.conf"

tried with both -o and -c arguments.

My mistake, I screwed up!

/usr/lib/postgresql/8.4/bin/pg_ctl start -D /media/extension/var/lib/postgresql/8.4/main/ -o "-c config_file="/etc/postgresql/8.4/main/postgresql.conf"

 (-c inside the quotes)

--Scott

Thanks,
Sairam Krishnamurthy
+1 612 859 8161

On 02/15/2011 04:27 PM, Scott Mead wrote:
/usr/lib/postgresql/8.4/bin/pg_ctl start -D /media/extension/var/lib/postgresql/8.4/main/ -o config_file="/etc/postgresql/8.4/main/postgresql.conf

Re: Moving the data directory

От
Scott Mead
Дата:


On Feb 15, 2011 5:44 PM, "Sairam Krishnamurthy" <kmsram420@gmail.com> wrote:
>
> Again,
>
> pg_ctl: could not open PID file "/media/extension/var/lib/postgresql/8.4/main/postmaster.pid": Permission denied
>
> Tried all the different ownership possible.

What about the permissions on your mountpoint?  Are they too restrictive for the postgres user?  ( or any of the higher level dirs)
>
> Thanks,
> Sairam Krishnamurthy
> +1 612 859 8161
>
>
> On 02/15/2011 04:37 PM, Scott Mead wrote:
>>
>>
>>
>> On Tue, Feb 15, 2011 at 5:32 PM, Sairam Krishnamurthy <kmsram420@gmail.com> wrote:
>>>
>>> Scott,
>>>
>>> I get this error.
>>>
>>> server starting
>>> krishnam@nipa-umh:/media/extension/var/lib$ postgres: invalid argument: "config_file=/etc/postgresql/8.4/main/postgresql.conf"
>>>
>>> tried with both -o and -c arguments.
>>
>>
>> My mistake, I screwed up!
>>
>> /usr/lib/postgresql/8.4/bin/pg_ctl start -D /media/extension/var/lib/postgresql/8.4/main/ -o "-c config_file="/etc/postgresql/8.4/main/postgresql.conf"
>>
>>  (-c inside the quotes)
>>
>> --Scott
>>
>>> Thanks,
>>> Sairam Krishnamurthy
>>> +1 612 859 8161
>>>
>>>
>>> On 02/15/2011 04:27 PM, Scott Mead wrote:
>>>>
>>>> /usr/lib/postgresql/8.4/bin/pg_ctl start -D /media/extension/var/lib/postgresql/8.4/main/ -o config_file="/etc/postgresql/8.4/main/postgresql.conf
>>
>>

Re: Moving the data directory

От
Sairam Krishnamurthy
Дата:
Scott,

I have 755 permission until "/media/extension/var/lib" and postgres owns the folder from postgresql.
Thanks,
Sairam Krishnamurthy
+1 612 859 8161

On 02/15/2011 04:48 PM, Scott Mead wrote:


On Feb 15, 2011 5:44 PM, "Sairam Krishnamurthy" <kmsram420@gmail.com> wrote:
>
> Again,
>
> pg_ctl: could not open PID file "/media/extension/var/lib/postgresql/8.4/main/postmaster.pid": Permission denied
>
> Tried all the different ownership possible.

What about the permissions on your mountpoint?  Are they too restrictive for the postgres user?  ( or any of the higher level dirs)
>
> Thanks,
> Sairam Krishnamurthy
> +1 612 859 8161
>
>
> On 02/15/2011 04:37 PM, Scott Mead wrote:
>>
>>
>>
>> On Tue, Feb 15, 2011 at 5:32 PM, Sairam Krishnamurthy <kmsram420@gmail.com> wrote:
>>>
>>> Scott,
>>>
>>> I get this error.
>>>
>>> server starting
>>> krishnam@nipa-umh:/media/extension/var/lib$ postgres: invalid argument: "config_file=/etc/postgresql/8.4/main/postgresql.conf"
>>>
>>> tried with both -o and -c arguments.
>>
>>
>> My mistake, I screwed up!
>>
>> /usr/lib/postgresql/8.4/bin/pg_ctl start -D /media/extension/var/lib/postgresql/8.4/main/ -o "-c config_file="/etc/postgresql/8.4/main/postgresql.conf"
>>
>>  (-c inside the quotes)
>>
>> --Scott
>>
>>> Thanks,
>>> Sairam Krishnamurthy
>>> +1 612 859 8161
>>>
>>>
>>> On 02/15/2011 04:27 PM, Scott Mead wrote:
>>>>
>>>> /usr/lib/postgresql/8.4/bin/pg_ctl start -D /media/extension/var/lib/postgresql/8.4/main/ -o config_file="/etc/postgresql/8.4/main/postgresql.conf
>>
>>

Re: Moving the data directory

От
Frederiko Costa
Дата:
What I meant was that when you install postgresql, you initialize the
area where your data directory will be. There you have the database,
config files, logs, etc. Before you restore the DB into the new pgsql,
as far as I'm aware, you have to create/init this area.

On Tue, Feb 15, 2011 at 2:27 PM, Sairam Krishnamurthy
<kmsram420@gmail.com> wrote:
> Can you explain a bit? I dint get what you mean data area.
>
> Thanks,
> Sairam Krishnamurthy
> +1 612 859 8161
>
> On 02/15/2011 04:09 PM, Frederiko Costa wrote:
>
> I would recommend to create the data area in the destination pgsql
> server and dump the source database into it, rather than copying the
> data directory.
>
> On Tue, Feb 15, 2011 at 1:41 PM, Sairam Krishnamurthy
> <kmsram420@gmail.com> wrote:
>
> All,
>
> I am using Ubuntu 10.04 and Postgres 8.4, I have been trying to move
> my data dir to another device for the past couple of days but ran into
> a lot of problems.
>
> I did the following:
>
> 1. Copy the contents of /var/lib/postgresql/8.4/main to my folder.
> 2. Changed the data_directory in postgresql.conf.
>
> When I start postgres using /etc/init.d script I get the following error,
>
> * Starting PostgreSQL 8.4 database server
>  * Error: could not exec /usr/lib/postgresql/8.4/bin/pg_ctl
> /usr/lib/postgresql/8.4/bin/pg_ctl start -D
> /media/extension/var/lib/postgresql/8.4/main/ -l
> /var/log/postgresql/postgresql-8.4-main.log -s -o  -c
> config_file="/etc/postgresql/8.4/main/postgresql.conf" :
>
>
> I tried changing the ownership of the
> /media/extension/var/lib/postgresql dir to <myusername>, postgres and
> root. Now of them worked and I keep getting the same error message.
>
> I found a lot of similar problems online but none had a solution.
>
> Can someone help me with this?
>
> TIA
>
> Thanks,
> Sairam Krishnamurthy
> +1 612 859 8161
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>
>

Re: Moving the data directory

От
Sairam Krishnamurthy
Дата:
Frederiko,

I will try that. I was hoping to have a better solution than to reinstall postgres.
Thanks,
Sairam Krishnamurthy
+1 612 859 8161

On 02/15/2011 04:56 PM, Frederiko Costa wrote:
What I meant was that when you install postgresql, you initialize the
area where your data directory will be. There you have the database,
config files, logs, etc. Before you restore the DB into the new pgsql,
as far as I'm aware, you have to create/init this area.

On Tue, Feb 15, 2011 at 2:27 PM, Sairam Krishnamurthy
<kmsram420@gmail.com> wrote:
Can you explain a bit? I dint get what you mean data area.

Thanks,
Sairam Krishnamurthy
+1 612 859 8161

On 02/15/2011 04:09 PM, Frederiko Costa wrote:

I would recommend to create the data area in the destination pgsql
server and dump the source database into it, rather than copying the
data directory.

On Tue, Feb 15, 2011 at 1:41 PM, Sairam Krishnamurthy
<kmsram420@gmail.com> wrote:

All,

I am using Ubuntu 10.04 and Postgres 8.4, I have been trying to move
my data dir to another device for the past couple of days but ran into
a lot of problems.

I did the following:

1. Copy the contents of /var/lib/postgresql/8.4/main to my folder.
2. Changed the data_directory in postgresql.conf.

When I start postgres using /etc/init.d script I get the following error,

* Starting PostgreSQL 8.4 database server
 * Error: could not exec /usr/lib/postgresql/8.4/bin/pg_ctl
/usr/lib/postgresql/8.4/bin/pg_ctl start -D
/media/extension/var/lib/postgresql/8.4/main/ -l
/var/log/postgresql/postgresql-8.4-main.log -s -o  -c
config_file="/etc/postgresql/8.4/main/postgresql.conf" :


I tried changing the ownership of the
/media/extension/var/lib/postgresql dir to <myusername>, postgres and
root. Now of them worked and I keep getting the same error message.

I found a lot of similar problems online but none had a solution.

Can someone help me with this?

TIA

Thanks,
Sairam Krishnamurthy
+1 612 859 8161

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: Moving the data directory

От
Frederiko Costa
Дата:
You might find something in the documentation about migrating the data
directory to another server.

~Fred
Linkedin profile: http://www.linkedin.com/in/frederikocosta



On Tue, Feb 15, 2011 at 2:58 PM, Sairam Krishnamurthy
<kmsram420@gmail.com> wrote:
> Frederiko,
>
> I will try that. I was hoping to have a better solution than to reinstall
> postgres.
>
> Thanks,
> Sairam Krishnamurthy
> +1 612 859 8161
>
> On 02/15/2011 04:56 PM, Frederiko Costa wrote:
>
> What I meant was that when you install postgresql, you initialize the
> area where your data directory will be. There you have the database,
> config files, logs, etc. Before you restore the DB into the new pgsql,
> as far as I'm aware, you have to create/init this area.
>
> On Tue, Feb 15, 2011 at 2:27 PM, Sairam Krishnamurthy
> <kmsram420@gmail.com> wrote:
>
> Can you explain a bit? I dint get what you mean data area.
>
> Thanks,
> Sairam Krishnamurthy
> +1 612 859 8161
>
> On 02/15/2011 04:09 PM, Frederiko Costa wrote:
>
> I would recommend to create the data area in the destination pgsql
> server and dump the source database into it, rather than copying the
> data directory.
>
> On Tue, Feb 15, 2011 at 1:41 PM, Sairam Krishnamurthy
> <kmsram420@gmail.com> wrote:
>
> All,
>
> I am using Ubuntu 10.04 and Postgres 8.4, I have been trying to move
> my data dir to another device for the past couple of days but ran into
> a lot of problems.
>
> I did the following:
>
> 1. Copy the contents of /var/lib/postgresql/8.4/main to my folder.
> 2. Changed the data_directory in postgresql.conf.
>
> When I start postgres using /etc/init.d script I get the following error,
>
> * Starting PostgreSQL 8.4 database server
>  * Error: could not exec /usr/lib/postgresql/8.4/bin/pg_ctl
> /usr/lib/postgresql/8.4/bin/pg_ctl start -D
> /media/extension/var/lib/postgresql/8.4/main/ -l
> /var/log/postgresql/postgresql-8.4-main.log -s -o  -c
> config_file="/etc/postgresql/8.4/main/postgresql.conf" :
>
>
> I tried changing the ownership of the
> /media/extension/var/lib/postgresql dir to <myusername>, postgres and
> root. Now of them worked and I keep getting the same error message.
>
> I found a lot of similar problems online but none had a solution.
>
> Can someone help me with this?
>
> TIA
>
> Thanks,
> Sairam Krishnamurthy
> +1 612 859 8161
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>
>
>

Re: Moving the data directory

От
Sairam Krishnamurthy
Дата:
I followed the preferred way to migrate the data and ran into this problem. So i guess I am stuck here and cant get any help from the docs.
Thanks,
Sairam Krishnamurthy
+1 612 859 8161

On 02/15/2011 04:59 PM, Frederiko Costa wrote:
You might find something in the documentation about migrating the data
directory to another server.

~Fred
Linkedin profile: http://www.linkedin.com/in/frederikocosta



On Tue, Feb 15, 2011 at 2:58 PM, Sairam Krishnamurthy
<kmsram420@gmail.com> wrote:
Frederiko,

I will try that. I was hoping to have a better solution than to reinstall
postgres.

Thanks,
Sairam Krishnamurthy
+1 612 859 8161

On 02/15/2011 04:56 PM, Frederiko Costa wrote:

What I meant was that when you install postgresql, you initialize the
area where your data directory will be. There you have the database,
config files, logs, etc. Before you restore the DB into the new pgsql,
as far as I'm aware, you have to create/init this area.

On Tue, Feb 15, 2011 at 2:27 PM, Sairam Krishnamurthy
<kmsram420@gmail.com> wrote:

Can you explain a bit? I dint get what you mean data area.

Thanks,
Sairam Krishnamurthy
+1 612 859 8161

On 02/15/2011 04:09 PM, Frederiko Costa wrote:

I would recommend to create the data area in the destination pgsql
server and dump the source database into it, rather than copying the
data directory.

On Tue, Feb 15, 2011 at 1:41 PM, Sairam Krishnamurthy
<kmsram420@gmail.com> wrote:

All,

I am using Ubuntu 10.04 and Postgres 8.4, I have been trying to move
my data dir to another device for the past couple of days but ran into
a lot of problems.

I did the following:

1. Copy the contents of /var/lib/postgresql/8.4/main to my folder.
2. Changed the data_directory in postgresql.conf.

When I start postgres using /etc/init.d script I get the following error,

* Starting PostgreSQL 8.4 database server
 * Error: could not exec /usr/lib/postgresql/8.4/bin/pg_ctl
/usr/lib/postgresql/8.4/bin/pg_ctl start -D
/media/extension/var/lib/postgresql/8.4/main/ -l
/var/log/postgresql/postgresql-8.4-main.log -s -o  -c
config_file="/etc/postgresql/8.4/main/postgresql.conf" :


I tried changing the ownership of the
/media/extension/var/lib/postgresql dir to <myusername>, postgres and
root. Now of them worked and I keep getting the same error message.

I found a lot of similar problems online but none had a solution.

Can someone help me with this?

TIA

Thanks,
Sairam Krishnamurthy
+1 612 859 8161

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



Re: Moving the data directory

От
Thomas Kellerer
Дата:
Sairam Krishnamurthy, 15.02.2011 23:43:
> Again,
>
> pg_ctl: could not open PID file "/media/extension/var/lib/postgresql/8.4/main/postmaster.pid": Permission denied
>
> Tried all the different ownership possible.

And you are sure you ran that as the postgres user?

Thomas

Re: Moving the data directory

От
Greg Smith
Дата:
Sairam Krishnamurthy wrote:
> I am using Ubuntu 10.04 and Postgres 8.4, I have been trying to move
> my data dir to another device for the past couple of days but ran into
> a lot of problems.
>
> I did the following:
>
> 1. Copy the contents of /var/lib/postgresql/8.4/main to my folder.
> 2. Changed the data_directory in postgresql.conf.
>
> When I start postgres using /etc/init.d script I get the following error,
>
> * Starting PostgreSQL 8.4 database server
>  * Error: could not exec /usr/lib/postgresql/8.4/bin/pg_ctl
> /usr/lib/postgresql/8.4/bin/pg_ctl start -D
> /media/extension/var/lib/postgresql/8.4/main/ -l
> /var/log/postgresql/postgresql-8.4-main.log -s -o  -c
> config_file="/etc/postgresql/8.4/main/postgresql.conf" :
>

Debian and Ubuntu installations have a unique feature where you can have
multiple PostgreSQL installations installed at the same time.
Accordingly, the standard ways of managing the database described in the
regular PostgreSQL documentation don't always work.  See
http://www.stuartellis.eu/articles/postgresql-setup/ for a quick intro
to this, specifically the "Using Multiple PostgreSQL Clusters" section.
What you may need to change here is not the database's postgresql.conf,
but instead the database cluster list you see when running pg_lsclusters.

--
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books


Re: Moving the data directory

От
"Dean Gibson (DB Administrator)"
Дата:
On 2011-02-16 04:51, Greg Smith wrote:
>
> Debian and Ubuntu installations have a unique feature where you can
> have multiple PostgreSQL installations installed at the same time.

That's pretty easy to do with any Linux distribution.

--
Mail to my list address MUST be sent via the mailing list.
All other mail to my list address will bounce.