[freeside-users] Moving data from one server to another?

Richard Siddall richard.siddall at elirion.net
Sat Sep 23 17:06:30 PDT 2006


Sales at MichianaWireless.Com wrote:
> I have a current working installation of freeside on an older server where
> the raid drives are now getting errors and are messed up. The server has to
> be started in rescue mode. So I am setting up a new freeside installation on
> a new computer and I would like to know how do you get the DATA from the
> 'other' freeside install to the 'new' freeside install?
> 

It's something like this.  Prior to going live with Freeside we did a
backup/restore test and this is a lightly edited version of the notes
from the test.

How to restore a Freeside installation:

For PostgreSQL, it's:
1/ Install the Freeside RPMs or install from the tarball, etc.  (You
don't do the whole "new install" procedure as you want to restore a
database dump instead of creating a new, empty database.)

2/ Restore the configuration files.  They
were in /usr/local/etc/freeside/conf*

3/ Create the freeside database user:
	su postgres -c 'createuser -P -A -d freeside'

4/ Create an empty freeside database:
	su freeside -c 'createdb freeside'
(Note: at this point you can use createdb --template=template0 to ensure
an empty database
or createdb --template=template1 to create a database with your local
enhancements.)

5/ Assuming your database dump* is in
/usr/local/etc/freeside/freeside.sql, load that into the database using:
	su postgres -c 'psql freeside < 'usr/local/etc/freeside/freeside.sql'
(Note: you must perform this as the postgres user as the dump contains
commands only the database superuser can perform.)
(Note: if you're restoring an outsource database instead of the main
freeside database, replace the database name, freeside in the example
above, with the outsource database name.)

6/ Restore any authentication database you use if not using basic HTTP
authentication.  (Files for this are usually located under
/usr/local/etc/freeside, so they will have been restored under step 2
above.)

7/ I think you need to run dbdef-create at this point.  (The notes
indicate you do, but we didn't discover this straight off.)

*freeside-daily will produce a database dump if you have set up the
configuration to enable the dump.

This assumes all the versions of software are the same on the old and
new machines.  If you upgrade anything, you may have to make some
alterations to the database schema or the dump file.  You're probably
better off installing the same version as on the old machine and then
doing an upgrade.

Obviously, you should go into the new installation and spot check to
make sure that the contents agree with the old installation.

Regards,

	Richard.



More information about the freeside-users mailing list