Re: Moving an existing database from an old version?

Поиск
Список
Период
Сортировка
От Aarni Ruuhimäki
Тема Re: Moving an existing database from an old version?
Дата
Msg-id 200701131238.28737.aarni@kymi.com
обсуждение исходный текст
Ответ на Moving an existing database from an old version?  (Howard Eglowstein <howard@yankeescientific.com>)
Ответы Re: Moving an existing database from an old version?
Список pgsql-novice
> What I want to do is simply transplant the existing application onto the
> new database. I'd be happy to simply copy the files over and hack the
> .conf files appropriately, or if it's better, can I use PG_DUMP to
> somehoe backup the old data and restore it to the new installation?
>
> I appreciate any pointers you may have or suggestions as to where else I
> might look.
>
> Or if you want to help out in exchange for lunch money, that could be
> arranged too. :)
>
> Thanks!
>
> Howard
>

Hi Howard,

Here's a rough guide line how to move or upgrade your db.

Just did this once again. (From FC2 / 8.0.1 to CentOs 4.4 / 8.1.5)

----
Take a dump from your db:

$pg_dumpall -c > dump_file_for_new

If you're upgrading on the same machine:

Shutdown postmaster:

Datadir out of the way:

#mv /usr/share/pgdata /usr/share/pgdata_old

New datadir:

#mkdir /usr/share/pgdata
#chown postgres /usr/share/pgdata

Previous install out of the way:

#mv /usr/share/pgsql /usr/share/pgsql_old

New istall:

Extract your new Pg:

#gunzip postgresql-8.x.tar.gz
#tar -xf postgresql-8.x.tar

Configure, make and install, with --prefix=/path/ you can specify install
directory, ie. the -L swicth in initdb, default is /usr/local/pgsql/:

#cd postgresql-8.x
#./configure --with...

#gmake or make
#gmake install or make install

Initdb:

#chown -R postgres /usr/local/pgsql/
#su postgres
$/usr/local/pgsql/bin/initdb -D /usr/share/pgdata -L /usr/local/pgsql/share -E
ENCODING

Edit & save .conf files

Start the server:

$/usr/local/pgsql/bin/postmaster -D /usr/share/pgdata -B no. of buffers -N no.
of connections &

You might want to add -i for outside connections (edit pg_hba.conf
accordingly)

Read your dump file in:

$psql -E template1 < dump_file_for_new
---

Cheers,

Aarni




В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Moving an existing database from an old version?
Следующее
От: Howard Eglowstein
Дата:
Сообщение: Re: Moving an existing database from an old version?