Old Koha Database to a New Installation
Moving Old Koha Database to a New Installation
This guide provides step-by-step instructions for transferring your old Koha database to a new installation.
1. Backup the Old Koha Database
First, take a backup of your existing Koha database. You can save it on an external drive or use the following command:
1
sudo mysqldump -uroot -p koha_library | xz > koha_library.sql.xz
You will be prompted to enter your MySQL root password.
2. Install Koha
Install the new version of Koha by following the installation instructions in the Koha-installtion.
3. Restore the Old Koha Database
a. Remove the existing database from the new Koha installation by executing the following commands:
1
sudo mysql -uroot -p
When prompted, enter your Linux and MySQL root passwords, then execute:
1
2
3
DROP DATABASE koha_library;
CREATE DATABASE koha_library;
QUIT;
b. Copy your backup file to your home folder. Extract the .sql
file and restore the old backup to the new Koha installation using:
1
sudo mysql -uroot -p koha_library < koha_library.sql
Replace koha_library
with the name of your source Koha database, if different.
4. Upgrade the Database Schema
To match the new version of Koha, upgrade the database schema with the following commands:
1
2
sudo service memcached restart
sudo koha-upgrade-schema library
Replace library
with your specific Koha instance name.
5. Rebuild the Zebra Index
Rebuild the Zebra index using this command:
1
sudo koha-rebuild-zebra -v -f library
Replace library
with your Koha instance name.
This process ensures that your Koha database is successfully migrated to the new installation and upgraded to the latest schema. If you need further assistance, feel free to reach out for support.