Restore a backup to a different disk?

Restore a backup to a different disk?

am 22.07.2010 15:41:03 von Just1Coder

--0-1251876282-1279806063=:56844
Content-Type: text/plain; charset=us-ascii

Good day all,

I am fairly new with PQSQL and am slowly picking things up - I have added a new
disk and would like to do two things:

1. Restore a backup to this new disk - /hda2/pgdata/
2. Move a database from /hda1/pgdata to /hda2/pgdata/

Any help is most appreciated, thank you.


--0-1251876282-1279806063=:56844
Content-Type: text/html; charset=us-ascii

Good day all, 

I am fairly new with PQSQL and am slowly picking things up - I have added a new disk and would like to do two things:

1. Restore a backup to this new disk - /hda2/pgdata/
2. Move a database from /hda1/pgdata to /hda2/pgdata/

Any help is most appreciated, thank you.





--0-1251876282-1279806063=:56844--

Re: Restore a backup to a different disk?

am 22.07.2010 18:52:59 von Kevin Grittner

a f wrote:

> I have added a new disk and would like to do two things:
>
> 1. Restore a backup to this new disk - /hda2/pgdata/
> 2. Move a database from /hda1/pgdata to /hda2/pgdata/

First I want to be clear about whether you want to restore and move
entire database *clusters*, or whether you want to deal with
individual databases within a cluster. A cluster is the level at
which you start and stop the server process, and it can contain many
databases

-Kevin

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

Re: Restore a backup to a different disk?

am 22.07.2010 19:17:02 von Just1Coder

--0-1931044126-1279819022=:87213
Content-Type: text/plain; charset=us-ascii

No cluster here, it is just a stand alone db server. Sorry if I sent this to the
wrong UG.

I have #2 down already; but #1 was focused on backing up MyDatabase that resides
on /hda1/pgdata, and restore it as MyDatabase2 on /hda2/pgdata.



________________________________
From: Kevin Grittner
To: pgsql-admin@postgresql.org; a f
Sent: Thu, July 22, 2010 12:52:59 PM
Subject: Re: [ADMIN] Restore a backup to a different disk?

a f wrote:

> I have added a new disk and would like to do two things:
>
> 1. Restore a backup to this new disk - /hda2/pgdata/
> 2. Move a database from /hda1/pgdata to /hda2/pgdata/

First I want to be clear about whether you want to restore and move
entire database *clusters*, or whether you want to deal with
individual databases within a cluster. A cluster is the level at
which you start and stop the server process, and it can contain many
databases

-Kevin

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



--0-1931044126-1279819022=:87213
Content-Type: text/html; charset=us-ascii

No cluster here, it is just a stand alone db server. Sorry if I sent this to the wrong UG.

I have #2 down already; but #1 was focused on backing up MyDatabase that resides on /hda1/pgdata, and restore it as MyDatabase2 on /hda2/pgdata.


From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: pgsql-admi
n@postgresql.org; a f <just1coder@yahoo.ca>
Sent: Thu, July 22, 2010 12:52:59 PM
Subject: Re: [ADMIN] Restore a backup to a different disk?

a f <> wrote:

> I have added a new disk and would like to do two things:
>
> 1. Restore a backup to this new disk - /hda2/pgdata/
> 2. Move a database from /hda1/pgdata to /hda2/pgdata/

First I want to be clear about whether you want to restore and move
entire database *clusters*, or whether you want to deal with
individual databases within a cluster.  A cluster is the level at
which you start and stop the server process, and it can contain many
databases

-Kevin

--
Sent via pgsql-admin mailing list (pgsql-admin@postgre sql.org)
To make changes to your subscription:
href="http://www.postgresql.org/mailpref/pgsql-admin" target="_blank">http://www.postgresql.org/mailpref/pgsql-adm in





--0-1931044126-1279819022=:87213--

Re: Restore a backup to a different disk?

am 22.07.2010 20:58:54 von Kevin Grittner

a f wrote:

> No cluster here, it is just a stand alone db server.

There's some terminology you've apparently not grasped yet -- when
PostgreSQL is running, the instance of the server is referred to as
a "cluster". If you're running a PostgreSQL database server, you
are running a cluster, in the terminology of the PostgreSQL world.
Within the cluster you normally have a template0 database, a
template1 database, a postgres database, and one or more application
databases.

> Sorry if I sent this to the wrong UG.

Posting to this list is fine for this question. pgsql-general or
pgsql-novice would also be OK, but having posted here, don't post on
another list unless the thread here goes dormant for at least a
couple days.

http://wiki.postgresql.org/wiki/Guide_to_reporting_problems

> I have #2 down already;

So you moved a PostgreSQL cluster from one mount point to another?
How, exactly, did you do that?

> but #1 was focused on backing up MyDatabase that resides on
> /hda1/pgdata, and restore it as MyDatabase2 on /hda2/pgdata.

Do you already have the backup you want to restore? If so, how was
it made, exactly?

-Kevin

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

Re: Restore a backup to a different disk?

am 22.07.2010 21:18:00 von Just1Coder

--0-1140954889-1279826280=:75183
Content-Type: text/plain; charset=us-ascii




>> but #1 was focused on backing up MyDatabase that resides on
>> /hda1/pgdata, and restore it as MyDatabase2 on /hda2/pgdata.

>Do you already have the backup you want to restore? If so, how was
>it made, exactly?


Yes.
I used pg_dump to make the backup.


--0-1140954889-1279826280=:75183
Content-Type: text/html; charset=us-ascii



>> but #1 was focused on backing up MyDatabase that resides on
>> /hda1/pgdata, and restore it as MyDatabase2 on /hda2/pgdata.

>Do y
ou already have the backup you want to restore?  If so, how was
>it made, exactly?

Yes. 
I used pg_dump to make the backup.





--0-1140954889-1279826280=:75183--

Re: Restore a backup to a different disk?

am 22.07.2010 22:48:33 von Kevin Grittner

a f wrote:

>>> but #1 was focused on backing up MyDatabase that resides on
>>> /hda1/pgdata, and restore it as MyDatabase2 on /hda2/pgdata.
>
>> Do you already have the backup you want to restore? If so, how
>> was it made, exactly?
>
>
> Yes.
> I used pg_dump to make the backup.

Well, if you made it without specifying any non-default options
you're not telling me about, you should initdb on the new drive (if
you haven't already), create any roles you had in the old database
which you want in the new one, create the database with the name you
want it to have, and run psql against that database using the file
created by pg_dump.

-Kevin

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

Re: Restore a backup to a different disk?

am 23.07.2010 08:16:03 von Andreas Schmitz

Reading this thread confuses me a little bit. There is no need to backup
a cluster in order to move it to another disk within the same machine.
Stopping the Database, moving $PGDATA, adjusting scripts and routines if
nessecary and firing up the whole thing would do fine.

regards

-Andreas


On 07/22/2010 10:48 PM, Kevin Grittner wrote:
> a f wrote:
>
>
>>>> but #1 was focused on backing up MyDatabase that resides on
>>>> /hda1/pgdata, and restore it as MyDatabase2 on /hda2/pgdata.
>>>>
>>
>>> Do you already have the backup you want to restore? If so, how
>>> was it made, exactly?
>>>
>>
>> Yes.
>> I used pg_dump to make the backup.
>>
>
> Well, if you made it without specifying any non-default options
> you're not telling me about, you should initdb on the new drive (if
> you haven't already), create any roles you had in the old database
> which you want in the new one, create the database with the name you
> want it to have, and run psql against that database using the file
> created by pg_dump.
>
> -Kevin
>
>


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