debian-sf-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Debian-sf-users] How to backup/Restore Sourceforge ?


From: Roland Mas
Subject: Re: [Debian-sf-users] How to backup/Restore Sourceforge ?
Date: Tue, 26 Feb 2002 14:02:34 +0100
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.1 (i386-debian-linux-gnu)

address@hidden (2002-02-26 11:46:13 +0100) :

> My debian Sourceforge on woody runs fine !  But before using it in a
> production environment I would like to experiment backup. Somebody
> have some experience with sourceforge backup ?

Yep, I have some experience there.  Here's how I do it.

> Particularly for the data base postgresql how to carry out the
> backup and the restoration ?

  The problem with PostgreSQL is you cannot reliably backup the data
unless you shut down the database.  I therefore use the following
script (in root's crontab, at time of night where I can reasonably
expect that there are no users):

,----[ sf-backup.sh ]
| #! /bin/sh
| 
| PATH=$PATH:/sbin:/usr/sbin
| 
| /usr/sbin/invoke-rc.d apache stop &> /dev/null
| sleep 5
| /usr/sbin/invoke-rc.d postgresql stop &> /dev/null
| tar czfC /var/lib/sourceforge/dumps/sf-postgresql-data.tar.gz / 
var/lib/postgres/data
| sleep 5
| /usr/sbin/invoke-rc.d postgresql start &> /dev/null
| sleep 15
| /usr/sbin/invoke-rc.d apache start &> /dev/null
`----

  As you can see, there's no deep magic involved, and I just backup
the PostgreSQL data directory into a nice tarball in the
/var/lib/sourceforge/dumps/ directory.  I then backup the
/var/lib/sourceforge/ directory (well, my sysadmins do that) so that I
also have the CVS repositories, web sites, users' homedirs, etc.

  Restoration is done the same way: shut down PostgreSQL, untar the
tarball, restart PostgreSQL.  Note that this will restore *all* the
PostgreSQL databases, not only sourceforge.  If your PostgreSQL server
hosts several databases, you might want to consider whether this
method is applicable or not (especially if you intend to restore
things in cases other than simply crash recovery).

> And for the LDAP data base ?

  Since it is entirely regenerated from the database automatically,
there should be no problem there.  On restore, just wait for the cron
job to happen (or force it to happen if you're impatient), and there
you are.

  Obviously, if you can spot any weak points in this method, please
share and enjoy, I'd be glad to improve it.

  Also, if you develop a better method or simply get to write a nice
document on how to backup/restore stuff, I'd gladly include it in the
package.

Roland.
-- 
Roland Mas

Late frost burns the bloom / Would a fool not let the belt / Restrain the body?
  -- in Good Omens (Terry Pratchett and Neil Gaiman)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]