Koha Backup and Restoration

 Koha Backup and Restoration


Run the following command from the terminal in order to take the backup of your Koha database. 

sudo mysqldump -u root -p koha_library > koha_library.sql

Enter the MySQL root password.

(Check the name of your database, in the above-mentioned command, root is a username for MySQL database (usually it is root unless you changed it) koha_library is a database name, and koha_library.sql is the name of the database backup file)

Now Restore the database backup in the newly installed Koha machine
Apply following commands

sudo su

(Hit Enter and enter the password)

sudo apt-get update

Open the MySQL database.

sudo mysql -uroot -p

Enter the MySQL database password
Drop (remove) the existing database from koha.

drop database koha_library;

Now create the new database named "koha_library"

create database koha_library;
quit;

Place your database backup file in the home folder.
Execute the below command to restore the old backup to the new Koha installation.

sudo mysql -uroot -p koha_library < koha_library.sql

Enter the MySQL database password. 

"koha_library" is the name of the database in the newly installed koha (Change it if you have created a database with the other name) and "koha_library.sql" is the name of the database file which will be restored.

Upgrade Database Schema
Apply the following commands  to upgrade the database schema

sudo service memcached restart

sudo koha-upgrade-schema library

Rebuild the Zebra Index.
Apply the following command

sudo koha-rebuild-zebra -v -f library

Comments

Popular posts from this blog

Install Dspace 7.2 on Ubuntu 22.04 LTS

How to delete library data in koha using the command line

Koha INSTALLATION

Total views