Move db files from one pgsql instance to another

Started by Javier de la Torreover 19 years ago4 messagesgeneral
Jump to latest
#1Javier de la Torre
jatorre@gmail.com

Hi,

I am working right now in an strategy to improve the performance on my
server. The situation is this:

I have a very large database that it is only update once a month, but
when is updated I have to process a lot of things on the data to
create caches, aditional tables, etc.

The processing of the data can take up to 2 days in my machine so I
was considering the following strategy.

I have another machine that takes the new data, process it and when is
done I replace the files from the production server with the ones of
the processing server.

In this way I avoid my production server to become really slow for 2
days every month.

Does this sound reasonable? Am I going to find any trouble just moving
the db files inside the data/base folder? I thought I would stop
PostgreSQL, do the replacement of files, actually just changing a
symbolyc link, and start the server again. I will only have my db
stopped for 5 sec. once a month.

Has anybody experince on something like this?

Thanks in advance.

Javier.

#2Jeff Davis
pgsql@j-davis.com
In reply to: Javier de la Torre (#1)
Re: Move db files from one pgsql instance to another

On Wed, 2006-08-16 at 20:04 +0200, Javier de la Torre wrote:

I am working right now in an strategy to improve the performance on my
server. The situation is this:

I have a very large database that it is only update once a month, but
when is updated I have to process a lot of things on the data to
create caches, aditional tables, etc.

The processing of the data can take up to 2 days in my machine so I
was considering the following strategy.

I have another machine that takes the new data, process it and when is
done I replace the files from the production server with the ones of
the processing server.

Start out here:
http://www.postgresql.org/docs/8.1/static/backup-online.html

You might also look into Slony-I:
http://www.slony.info

Do those seem like they will solve your problem?

Regards,
Jeff Davis

#3Javier de la Torre
jatorre@gmail.com
In reply to: Jeff Davis (#2)
Re: Move db files from one pgsql instance to another

Yes!

Thanks. It pointed me out to File system level backup. And there I
found a very important hint... you have to restore the whole database
cluster. I suppose this means that I have to transfer all databases in
my postgresql...

What is actually a pity because there is a db on the production site
that will be lost... well, I can backup this one without ptoblems and
reinsert it after.

Thanks again.

Javier.

Show quoted text

On 8/16/06, Jeff Davis <pgsql@j-davis.com> wrote:

On Wed, 2006-08-16 at 20:04 +0200, Javier de la Torre wrote:

I am working right now in an strategy to improve the performance on my
server. The situation is this:

I have a very large database that it is only update once a month, but
when is updated I have to process a lot of things on the data to
create caches, aditional tables, etc.

The processing of the data can take up to 2 days in my machine so I
was considering the following strategy.

I have another machine that takes the new data, process it and when is
done I replace the files from the production server with the ones of
the processing server.

Start out here:
http://www.postgresql.org/docs/8.1/static/backup-online.html

You might also look into Slony-I:
http://www.slony.info

Do those seem like they will solve your problem?

Regards,
Jeff Davis

#4Jeff Davis
pgsql@j-davis.com
In reply to: Javier de la Torre (#3)
Re: Move db files from one pgsql instance to another

On Wed, 2006-08-16 at 20:37 +0200, Javier de la Torre wrote:

Yes!

Thanks. It pointed me out to File system level backup. And there I
found a very important hint... you have to restore the whole database
cluster. I suppose this means that I have to transfer all databases in
my postgresql...

What is actually a pity because there is a db on the production site
that will be lost... well, I can backup this one without ptoblems and
reinsert it after.

If you look at Slony, that's a table-level backup solution that may fit
your needs. Online backup and PITR operate on the entire database
cluster, but with Slony you can replicate on a per-table basis.

Regards,
Jeff Davis