
Old Koha Database to a New Installation
Migrating your Koha Integrated Library System (ILS) to a new server or upgraded environment is essential for better performance, security, and long-term sustainability. But without a proper plan, it can lead to data loss or system errors. This guide walks you through the complete process of moving your old Koha database to a fresh installation.
Step 1: Backup Your Existing Koha Database
Before making any changes, ensure that your current Koha data is safely backed up. Use the following command on your existing server
This command creates a compressed backup of your koha_library
database. Store this .xz
file safely on a USB drive or external storage.
Step 2: Install Koha on the New System
Set up a fresh Koha environment on your new server. Follow the official Koha installation documentation for your specific Linux distribution. Make sure the Koha instance is named correctly (e.g., library
) and all dependencies are installed.
Step 3: Restore the Old Database
-
Open MySQL as root:
-
Drop the default database and create a new one:
-
Move your backup file to the home directory of the new server and extract it:
-
Restore the backup into the newly created database:
Make sure that the database name matches the instance name configured in your Koha installation.
Step 4: Upgrade Koha Database Schema
Older database versions may not be compatible with the new Koha version. To fix this, upgrade the schema using:
This will apply any necessary changes and align your database with the latest Koha structure.
Step 5: Rebuild the Zebra Index
Zebra indexing enables search features in Koha. Rebuild the index using the command:
This ensures that bibliographic and authority records are correctly indexed and searchable.
Final Thoughts
Migrating Koha to a new installation doesn’t have to be complicated. With proper backups, clean installation, and careful restoration, you can maintain service continuity while benefiting from a modern setup. Always test your restored Koha system thoroughly before going live.