Database Backup and Restoration of Koha - Integrated Library System!

  

 



Database backup is an important task of any library system. All the data, including issues, returns, etc., are very important for any library. We must secure our data by taking a backup either locally or externally. Database backup helps us from loss of data. If we want to take a koha database backup, we have to take a MySQL database backup first. To do so, we have run some commands in our terminal. 


Login as Superuser :

sudo su

Enter the password of the system.


Back up the Database :

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

  
 
It will store the backup file in the Home folder.


Now, using a storage device like a Pen drive, copy the "koha_library.sql.xz" file and paste it into the new computer where the latest Koha version is installed. Also, cloud storage may be considered for the transfer of the backup file. Koha backup file needs to be stored in the Home folder, and the "sql.xz" file extracted there, and the file extension will be .sql. If anyone wants to know about the koha installation process, click here.


Restoration of the old koha Database


Remove the existing database of the newly installed Koha.

sudo mysql -uroot -p

Enter the MySQL root password.


Now, delete the MySQL database.


drop database koha_library;


Create a new database with the same name.


create database koha_library;


quit;


Now, apply the following commands in the Terminal for the restoration of the database.


sudo mysql -uroot -p koha_library < koha_library.sql


Enter the MySQL root password.


Database Schema Upgradation

Now, the database schema should be upgraded. Apply the following commands


sudo service memcached restart

sudo koha-upgrade-schema library



Rebuild the Zebra Index


sudo koha-rebuild-zebra -v -f library


Your latest koha installation is now available with your old data.

 

No comments:

Popular Posts

Powered by Blogger.