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 < /home/koha/Downloads/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