I have a single Postgres db that I would like to move it into /home. How can this be done ? TIA, Duaine -- Duaine Hechler Piano, Player Piano, Pump Organ Tuning, Servicing& Rebuilding Reed Organ Society Member Florissant, MO 63034 (314) 838-5587 dahechler@att.net www.hechlerpianoandorgan.com -- Home& Business user of Linux - 11 years -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Wed, 2012-02-15 at 14:41 -0600, Duaine Hechler wrote:
I have a single Postgres db that I would like to move it into /home. How can this be done ?
pg_dump / pg_restore ? Seriously, that is the only way I'd move an individual database. But I'm not sure what you mean by "move it into /home". -- System & Network Administrator [ LPI & NCLA ] <http://www.whitemiceconsulting.com> OpenGroupware Developer <http://www.opengroupware.us> Adam Tauno Williams -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 02/15/2012 03:07 PM, Adam Tauno Williams wrote:
I have a single Postgres db that I would like to move it into /home. How can this be done ?
On Wed, 2012-02-15 at 14:41 -0600, Duaine Hechler wrote: pg_dump / pg_restore ?
Seriously, that is the only way I'd move an individual database.
But I'm not sure what you mean by "move it into /home".
It's for my home business accounting and every time I upgrade, I keep getting into trouble - somehow - and have to scramble to get it restored. Duaine -- Duaine Hechler Piano, Player Piano, Pump Organ Tuning, Servicing& Rebuilding Reed Organ Society Member Florissant, MO 63034 (314) 838-5587 dahechler@att.net www.hechlerpianoandorgan.com -- Home& Business user of Linux - 11 years -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Am 15.02.2012 22:49, schrieb Duaine Hechler:
On 02/15/2012 03:07 PM, Adam Tauno Williams wrote:
I have a single Postgres db that I would like to move it into /home. How can this be done ?
On Wed, 2012-02-15 at 14:41 -0600, Duaine Hechler wrote: pg_dump / pg_restore ?
Seriously, that is the only way I'd move an individual database.
But I'm not sure what you mean by "move it into /home".
It's for my home business accounting and every time I upgrade, I keep getting into trouble - somehow - and have to scramble to get it restored.
In my other post I described how to move the DB datadirectory. As you mention upgrades it is really is necessary to do a pg_dump before you upgrade postgresql to a newer release by yast or manually by installing a newer release package by EnterpriseDB. In the scenario of a operating system upgrade it only makes sense to move the db-data-directory to /home if /home sits on an own partition. Then still Adam is right. You need to do a pg_dump as PG's major release most likely will have changed in the time a new SUSE distro got put together. So I suppose your /home sits on an own partition. Even better add another harddrive and setup a soft-raid1 so that a partition on both drives get mirrored in case one drive kicks the bucket. Mount it e.g. to /raid. Mind you, as I installed OpenSuse 12.1 there was a bug in systemd that prohibited booting with a mounted raid1 even though it hadn't / in it. When I switched systemd against sysinit while I installled OpenSuse 12.1 the problem disapeared. Maybe it is fixed by now. so 1) do a pg_dump 2) install your suse system upgrade 3) stop the pg-server 4) move the data-dir as I described in my earlier post to /home/pgsql or /raid/pgsql 5) restart the pg-server 6) then import the dumped database done -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Wed, 2012-02-15 at 15:49 -0600, Duaine Hechler wrote:
On 02/15/2012 03:07 PM, Adam Tauno Williams wrote:
I have a single Postgres db that I would like to move it into /home. How can this be done ?
On Wed, 2012-02-15 at 14:41 -0600, Duaine Hechler wrote: pg_dump / pg_restore ? Seriously, that is the only way I'd move an individual database. But I'm not sure what you mean by "move it into /home". It's for my home business accounting and every time I upgrade, I keep getting into trouble - somehow - and have to scramble to get it restored.
Moving it won't help that. If you have a database you are regularly using you need to regularly pg_dump. Setup a script for yourself and potentially a cron task just to do that at some interval. -- System & Network Administrator [ LPI & NCLA ] <http://www.whitemiceconsulting.com> OpenGroupware Developer <http://www.opengroupware.us> Adam Tauno Williams -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Am 15.02.2012 21:41, schrieb Duaine Hechler:
I have a single Postgres db that I would like to move it into /home.
How can this be done ?
rather easy make a backup of your database with pg_dump just in case ideally we won't need it, though shut down the pg server rcpostgresql stop move the datadirectory somewhere else start yast --> applications --> postgresql --> postgresql_datadirectory set the path to where you like it --> Finish close yast restart the pg server rcpostgresql start done <http://www.youtube.com/watch?v=nwWwNcMjlsI&feature=related> -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 02/15/2012 06:17 PM, Andreas wrote:
Am 15.02.2012 21:41, schrieb Duaine Hechler:
I have a single Postgres db that I would like to move it into /home.
How can this be done ?
rather easy
make a backup of your database with pg_dump just in case ideally we won't need it, though
shut down the pg server
rcpostgresql stop move the datadirectory somewhere else start yast --> applications --> postgresql --> postgresql_datadirectory set the path to where you like it --> Finish close yast restart the pg server rcpostgresql start
done
WOW .... that was easy. Now, will I have to change that is I need to reinstall from scratch ? Thanks, Duaine -- Duaine Hechler Piano, Player Piano, Pump Organ Tuning, Servicing& Rebuilding Reed Organ Society Member Florissant, MO 63034 (314) 838-5587 dahechler@att.net www.hechlerpianoandorgan.com -- Home& Business user of Linux - 11 years -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Am 16.02.2012 02:12, schrieb Duaine Hechler:
On 02/15/2012 06:17 PM, Andreas wrote:
Am 15.02.2012 21:41, schrieb Duaine Hechler:
I have a single Postgres db that I would like to move it into /home.
How can this be done ?
rather easy
make a backup of your database with pg_dump just in case ideally we won't need it, though
shut down the pg server
rcpostgresql stop move the datadirectory somewhere else start yast --> applications --> postgresql --> postgresql_datadirectory set the path to where you like it --> Finish close yast restart the pg server rcpostgresql start
done
WOW .... that was easy. Now, will I have to change that is I need to reinstall from scratch ?
In case you just want to move the data directory you don't need to reinstall anything. PG just needs to know where it's data directory is. Of course you can't move the data directory while the pg-server is running. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (3)
-
Adam Tauno Williams
-
Andreas
-
Duaine Hechler