From: | Craig Ringer <craig(at)postnewspapers(dot)com(dot)au> |
---|---|
To: | iztech <rashantha(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: file system level backup |
Date: | 2008-06-13 00:54:34 |
Message-ID: | 4851C54A.1080906@postnewspapers.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
iztech wrote:
> On Jun 12, 6:31 am, iztech <rashan(dot)(dot)(dot)(at)gmail(dot)com> wrote:
>> i have just switched to posgresql and installed for use with ruby.
>>
>> i need to move my app and database to a new server. since i can shut
>> down the server i think it will be easier for me to do a file system
>> level back up.
pg_dump and pg_restore should be just as good. If you're having trouble
manging postgresql they're probably a safer bet.
>> when i try to shut the server down i get this message
>>
>> sudo -u postgres pg_ctl -D /opt/local/var/db/postgresql82/defaultdb
>> stop
>> pg_ctl: PID file "/opt/local/var/db/postgresql82/defaultdb/
> can anyone let me know how i can tell where the db are located?
You've left out some key information, like your operating system, OS
version, postgresql version, and how you installed postgresql.
In general you should use the OS init script if provided to start and
stop postgresql. With most packaged Pg installs you can find the data
directory by examining the data_directory parameter in postgresql.conf,
which will normally be in a 'postgresql' directory under /etc .
If you hand-installed it (which looks like the case based on your
command line, above) then you should really know where the data
directory is because you had to run initdb to create it.
The -D argument on the command line above is the path to your data
directory. It's not clear whether that command is just copied & pasted
from somewhere else, because I'm a bit confused as to why you'd be
asking where the data directory was if you understood that. Check
postgresql.conf to confirm that the -D argumenet above is actually correct.
>> this is my first time attempting this. can someone suggest an easy
>> tutorial on this.
If you're new to Pg, just get the packages for your operating system if
they're reasonably recent. You can then use the OS init scripts and
normal management tools to handle Pg.
>> i have set up the new server with the same permissions so i should be
>> able to move the db to the new location.
Maybe. The version must be the same except for the patchlevel, eg
"8.2.1" is compatible with "8.2.3" but not "8.3.1". In general it is
MUCH SAFER to just use pg_dump and pg_restore to migrate your data.
--
Craig Ringer
From | Date | Subject | |
---|---|---|---|
Next Message | iztech | 2008-06-13 04:53:19 | Re: file system level backup |
Previous Message | Ben | 2008-06-12 23:29:33 | Re: understanding a nested query |