473,406 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Backup and Restore of PostgreSQL

Hi All,

I have a java web server (Tomcat) running a web application that uses PostgreSQL for all
of the data. All of the management of the application is done through the web application
and I would like to provide a backup and restore option for the user. Backup would
somehow get all of the data/schema (maybe not schema) from the DB and zip it and send it
to the customer through the web-app to allow them to save the backup on their local
machine. They could then select this backup file to restore the DB to the state that it
was when the backup was taken.

The backing up and restoring of the system is restricted to administrators of the
web-application (most likely only one person). Backup's would probably be done on a daily
basis with restores only needed upon FUBAR.

What would be the best way of handling this?
Platform is most likely windows, but I would like a system that would work cross platform,
as that is why the whole system uses Java and PostgreSQL as these are available for
Win/Linux/OSX which are the most common desktop OSs.

Ideas, comments or pointers most welcome.

Thanks,
Tim

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #1
6 2984
Tim Penhey wrote:
Hi All,

I have a java web server (Tomcat) running a web application that uses PostgreSQL for all
of the data. All of the management of the application is done through the web application
and I would like to provide a backup and restore option for the user. Backup would
somehow get all of the data/schema (maybe not schema) from the DB and zip it and send it
to the customer through the web-app to allow them to save the backup on their local
machine. They could then select this backup file to restore the DB to the state that it
was when the backup was taken.


The pg_dump utility is the standard way to backup PostgreSQL and the
custom format is already compressed.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #2
Tim Penhey wrote:
Hi All,

I have a java web server (Tomcat) running a web application that uses PostgreSQL for all
of the data. All of the management of the application is done through the web application
and I would like to provide a backup and restore option for the user. Backup would
somehow get all of the data/schema (maybe not schema) from the DB and zip it and send it
to the customer through the web-app to allow them to save the backup on their local
machine. They could then select this backup file to restore the DB to the state that it
was when the backup was taken.


The pg_dump utility is the standard way to backup PostgreSQL and the
custom format is already compressed.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #3
Richard Huxton mentioned:

Tim Penhey wrote:
Hi All,

I have a java web server (Tomcat) running a web application that uses

PostgreSQL for all
of the data. All of the management of the application is done through the

web application
and I would like to provide a backup and restore option for the user. Backup would
somehow get all of the data/schema (maybe not schema) from the DB and zip it

and send it
to the customer through the web-app to allow them to save the backup on their local
machine. They could then select this backup file to restore the DB to the

state that it
was when the backup was taken.


The pg_dump utility is the standard way to backup PostgreSQL and the
custom format is already compressed.

--
Richard Huxton
Archonet Ltd


The question though is how to call this from a java servlet / hopefully in a OS
independant way.

Tim

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #4
Richard Huxton mentioned:

Tim Penhey wrote:
Hi All,

I have a java web server (Tomcat) running a web application that uses

PostgreSQL for all
of the data. All of the management of the application is done through the

web application
and I would like to provide a backup and restore option for the user. Backup would
somehow get all of the data/schema (maybe not schema) from the DB and zip it

and send it
to the customer through the web-app to allow them to save the backup on their local
machine. They could then select this backup file to restore the DB to the

state that it
was when the backup was taken.


The pg_dump utility is the standard way to backup PostgreSQL and the
custom format is already compressed.

--
Richard Huxton
Archonet Ltd


The question though is how to call this from a java servlet / hopefully in a OS
independant way.

Tim

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #5
Tim Penhey wrote:
Richard Huxton mentioned:

The pg_dump utility is the standard way to backup PostgreSQL and the
custom format is already compressed.
The question though is how to call this from a java servlet / hopefully in a OS
independant way.


Well, obviously file-paths can be dealt with simply, and pg_dump will
output to a named file, so you're ok there.
As for safely calling external programs, that's probably more a question
for the servlet system (Tomcat I think you said) - it's not different to
calling any other external program.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #6
Tim Penhey wrote:
Richard Huxton mentioned:

The pg_dump utility is the standard way to backup PostgreSQL and the
custom format is already compressed.
The question though is how to call this from a java servlet / hopefully in a OS
independant way.


Well, obviously file-paths can be dealt with simply, and pg_dump will
output to a named file, so you're ok there.
As for safely calling external programs, that's probably more a question
for the servlet system (Tomcat I think you said) - it's not different to
calling any other external program.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Eric Herber | last post by:
I've a question regarding db2 (V8.1) and database backups going to a storage manager like TSM for example. As I can see in the storage manager if I backup the complete database over the TSM API...
4
by: Hardy | last post by:
hi gurus, now I have to backup and restore a 8 T size db2 database. from two s85 to two 670. the partitions,tablespaces of the db should be redesigned then I plan to use redirected restore. but...
0
by: Aienthiwan | last post by:
Hello all, I'm running a debian server and recently updated my version of PostgreSQL to "unstable", that being v7.4.1. I had no trouble at all getting everything up to date and going. But my...
1
by: Sally Sally | last post by:
Thank you all for replying. I appreciate the tips. Apologies to those who were offended by the html formating. Scott, quick question. The reason I assumed insert would be "safer" than copy is...
12
by: zuhans | last post by:
-------- Original-Nachricht -------- Betreff: backup and restore just with use of jdbc? Datum: Sun, 13 Jun 2004 10:23:53 +0200 Von: zuhans@iname.com <zuhans@iname.com> An:...
1
by: Bill Harris | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I had been running 7.x under cygwin (about 2 versions behind the latest cygwin has), but cygserver stopped running on my last cygwin update, and it...
0
by: Acm | last post by:
I am working with Python 2.5 and Postgresql 8.2.4. I would like to know how to perform the backup and restore operations on postgresql through a python API (e.g. psycopg2). Thank you.
0
by: glubber | last post by:
I have a cronned perl script that runs on a different server. when I try to restore it to the server below things dont copy across correctly. the target server is described below. debian 4.0...
0
by: bibico | last post by:
how could i include tables and types dependent to each other during backup. I am using postgresql 8.2. When doing the backup/restore on the same system, no problem - all is there and complete....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.