Showing posts with label upgrade. Show all posts
Showing posts with label upgrade. Show all posts

Upgrade/migration from a very old version of Koha

Libraries stick on with old versions of Koha facing difficulties while trying to upgrade to the new version. Upgrading from very old versions to the latest version may result in data loss. Koha stops the official support for older versions after a specific period. Same way, Koha support for old Ubuntu versions stops when it becomes obsolete. New versions of Koha introduce a lot of improvements and new features. Changes in database structure required to accommodate new features. For example, Koha version 3.18 released in 2014, and it has 168 tables. Version 19.05, released in 2019, has 204 tables. Koha developers strongly recommend for the regular up-gradation to recent versions. The database structure is also subject to changes during the upgrade process.

Direct up-gradation from old versions (e.g. versions before version 3.18) to the latest version probably ends in data loss. Restoration of an old version of Koha is a challenging task. Data migration from a running instance of an old version of Koha is comparatively easy. Porting of bibliographic records to MARC format, patron details, and circulation details to CSV is possible. Then it can be imported into a new version of Koha. Following steps can follow to export essential data:
  • Note down all configurations with Koha including branch code, item types codes, authorized values, circulation and rules. Take screenshots of all configurations.
  • Export bibliographic details (MARC format) into MARC.
  • Export patron and circulation details into CSV format using reports.
  • Install a new version of Koha. Create branch code, Patron categories, Authorised values, circulation match with the old version of Koha.
  • Import MARC file, patron, and circulation details.
Note: Consult Koha release notes and installation manual at Koha Wiki for regular updates on changes.

Install the latest version of MariaDB with Koha

Image courtesy: Mariadb.org
MariaDB is a community fork of MySQL. Latest versions of Koha support MariaDB. Current versions of Ubuntu and Debian repository provide the old version of MariaDB. Users can add the latest version of MariaDB by adding the software repository. The following method can install MariaDB 10.3 with an existing Koha installation on Ubuntu 16.04 LTS. MariaDB installation details can be found at mariadb.org

Installation of MariaDB
The process includes adding the MariaDB repository information to Ubuntu and install the database. Take a backup of the Koha database before the installation process.

Upgrade Ubuntu
Open a terminal and apply the following commands one by one;

sudo apt-get update 
sudo apt-get upgrade

Add MariaDB repository
Login as Root User.

sudo su

apt-get install curl software-properties-common dirmngr

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash

Install MariaDB

apt-get install mariadb-server

Need to enter the Root password when the installation process ask. Give the same old MySQL root password.

After the installation try to Log into MariaDB,

sudo su
mysql -uroot -p

You will get following message,

ERROR 1524 (HY000): Plugin 'unix_socket' is not loaded

Go to the following link and apply the solution mentioned in the forum to fix it,

https://askubuntu.com/questions/705458/ubuntu-15-10-mysql-error-1524-unix-socket

Reference
https://mariadb.com/kb/en/library/mariadb-package-repository-setup-and-usage/

Move old Koha database to new installation

1. Backup of old Koha
Take the backup of your existing Koha database. Either you can make use a database kept in your pen drive otherwise you can apply following command to take the backup,

sudo mysqldump -uroot -p koha_library | xz > koha_library.sql.xz

Put MySQL root password, when it asks.

2. Install Koha

Follow the instructions in Koha wiki

3. Restoration of old Koha database to a new one
Remove the existing database in the new Koha installation

sudo mysql -uroot -p 

[Enter the Linux password and after that enter MySQL Root password]

drop database koha_library;
create database koha_library;
quit;

Copy your database backup from your pen drive to home folder.
Extract the backup file, the extension will be .sql
Then restore the old backup to the new Koha installation.

Database Restoration commands,

sudo mysql -uroot -p koha_library < koha_library.sql     
[Check name of your source Koha database] 
exit

koha_library - name of database in new installation
koha.sql - name of database in old installation
Enter the MySQL root password.

4. Upgrade Database Schema
Database schema of old Koha should upgrade to match with the new version. Apply following commands in a terminal one by one,

sudo service memcached restart

sudo koha-upgrade-schema library

5. Rebuild the Zebra Index.

Apply following command in a terminal,

sudo koha-rebuild-zebra -v -f library

DBD::mysql::db do failed: Table 'koha_library.roadtype' doesn't exist

I got following error message while upgrade to Koha version 3.16,

DBD::mysql::db do failed: Table 'koha_library.roadtype' doesn't exist at
/usr/share/koha/intranet/cgi-bin/installer/data/mysql/updatedatabase.pl
line 7987.
DBD::mysql::db do failed: Table 'koha_library.roadtype' doesn't exist at
/usr/share/koha/intranet/cgi-bin/installer/data/mysql/updatedatabase.pl
line 7987.
dpkg: error processing koha-common (--configure):
 subprocess installed post-installation script returned error exit status
255
E: Sub-process /usr/bin/dpkg returned an error code (1)

Up gradation process in web interface does not proceed and it repeat it again and again.

I solved the problem using following steps,
 
Open a terminal and open following file,

sudo su
leafpad /usr/share/koha/intranet/cgi-bin/installer/data/mysql/updatedatabase.pl

Search > Jump To > 7985

Find the line
$dbh->{RaiseError} = 1;

Change the value 1 to 0.
Save file.

Go back to koha and refresh the page.

 

Koha upgrade

The new version of Koha release every six months with a bundle of new features. Updates also release during the six months.

Up-gradation is easy with Koha installation based on Debian packages.

Apply the following command in Applications > Accessories > Terminal

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install koha-common



If any errors show, install again repository key.

wget -O- http://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -

Again repeat the upgrade process.

Clean the packages after upgradations,

sudo apt-get clean


Upgrade Database Schema
Database schema of old Koha should upgrade to new one. Apply following commands in a terminal,

sudo koha-upgrade-schema library

Rebuild the Zebra Index.

Apply following command in a terminal,

sudo koha-rebuild-zebra -v -f library