Moving your old Koha database to a new installation involves backing up the old database, restoring it to the new server, and reconfiguring Koha to use the restored data. Here’s a step-by-step guide to ensure a smooth migration.
- Step 1: Backup the Old Koha Database
- Step 2: Transfer the Backup to the New Server
- Step 3: Prepare the New Koha Installation
- Step 4: Import the Old Database
- Step 5: Update Koha Configuration
- Step 6: Start Koha Services and Verify
Database Backup: Securely back up the existing Koha database from the old server.
Data Transfer: Transfer the backup file to the new server using secure protocols.
Koha Installation: Install and configure Koha on the new server.
Database Restoration: Import the old database into the new Koha installation.
Configuration Update: Modify Koha configuration files for seamless integration.
Index Rebuild: Rebuild Zebra or Elasticsearch indexes (if required) to ensure proper search functionality.
Testing & Verification: Validate data integrity, including patron records, catalog, and circulation history.
OLD_SERVER="old-server-ip"
NEW_SERVER="new-server-ip"
USER="root"
PASSWORD="your-mysql-password"
DB_NAME="koha_library"
# Backup & Transfer
ssh $USER@$OLD_SERVER "mysqldump -u $USER -p$PASSWORD $DB_NAME > /tmp/koha_backup.sql"
scp $USER@$OLD_SERVER:/tmp/koha_backup.sql $USER@$NEW_SERVER:/tmp/
# Restore on New Server
ssh $USER@$NEW_SERVER << EOF
mysql -u $USER -p$PASSWORD -e "DROP DATABASE IF EXISTS $DB_NAME; CREATE DATABASE $DB_NAME;"
mysql -u $USER -p$PASSWORD $DB_NAME < /tmp/koha_backup.sql
sudo systemctl restart koha-common
EOF
echo "Koha database migration completed successfully."

Writeride

Leave a Reply