Re: Moving an existing database from an old version?
От | Howard Eglowstein |
---|---|
Тема | Re: Moving an existing database from an old version? |
Дата | |
Msg-id | 45A8CC5B.8040208@yankeescientific.com обсуждение исходный текст |
Ответ на | Re: Moving an existing database from an old version? (Aarni Ruuhimäki <aarni@kymi.com>) |
Ответы |
Re: Moving an existing database from an old version?
Re: Moving an existing database from an old version? |
Список | pgsql-novice |
Thank you all for the suggestions!! I wouldn't have guessed that you _can't_ just move the data, but it makes sense that you can't. I'm still having trouble figuring out where the data is on the existing machine. I've looked in /usr/local and /usr/share for places it might be and there doesn't seem to be any. Yet, pg_dump clearly knows how to find it. Last question for now (before I fire up the machine and try again): How does postgresql know where the data lives? Thanks again to everyone! Howard Aarni Ruuhimäki wrote: >> 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 > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend > >
В списке pgsql-novice по дате отправления: