Moving an installation from a regular install to the Debian packages

From Koha Wiki
Jump to navigation Jump to search

This guide assumes you have one Koha installation running as a "normal" installation on Debian, and you want to switch to using the packages, on the same server.

Initially, this is a draft based on running through the process once, feel free to correct, elaborate and improve.

Caveat: So far, this guide does not explain how to get rid of all the old files associated with the regular install.

What you need

  • Debian Squeeze (a.k.a. version 6.x). If you have an older version of Debian (e.g. Lenny) you will have to upgrade to Squeeze, which is a process beyond the scope of this wiki.

Backup

Before you do anything, backup your database!

$ mysqldump -u <dbuser> -p <dbname> > mybackup.sql

See also: Backing up Koha

Get rid of some of the old stuff

Cron

Remove any Koha-related tasks in cron.

$ crontab -e 

Zebra

De-daemonize Zebra.

$ sudo update-rc.d -f koha-zebra-daemon remove
$ sudo rm /etc/init.d/koha-zebra-daemon

Apache

Disable the Koha site.

$ sudo a2dissite koha
$ sudo /etc/init.d/apache2 reload

Install koha-common

Follow the instructions on Koha 3.6 on Debian Squeeze, up to and including the point where it has you doing:

$ apt-get install koha-common

You might get a number of questions like this:

Configuration file `/etc/koha/zebradb/ccl.properties'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
  What would you like to do about it ?  Your options are:
   Y or I  : install the package maintainer's version
   N or O  : keep your currently-installed version
     D     : show the differences between the versions
     Z     : start a shell to examine the situation
The default action is to keep your current version.
*** ccl.properties (Y/I/N/O/D/Z) [default=N] ?

What you answer here will depend on whether you have any customisations in the relevant files that you need to keep or not.

Get your site up and running

Edit /etc/koha/koha-sites.conf to your liking.

Run:

$ sudo koha-create --create-db <instancename>

Instancename will be used as part of your domain name, so choose something that matches what you want the URL to your Koha to be. If you want it to live at koha.example.org, you should use "koha" for your instancename.

Running this will create a new database called koha_<instancename>, so if your old database was called simply "koha", it will not be affected by running this command.

Now load your databasedump:

$ sudo koha-mysql <instancename> < mybackup.sql

Upgrade the schema:

$ sudo koha-upgrade-schema <instancename>

And rebuild the Zebra indexes:

$ sudo koha-rebuild-zebra -f -v <instancename>

(-f = full reindex, -v = verbose)

And that should have you up and running again!