This guide will help you migrate a Koha 16.05 instance from an older Ubuntu 14.04.6 LTS server to a new Ubuntu 22.04 LTS server. The instance will be named "koha16".
- Ensure you have a backup of your Koha database and configuration files.
- Verify the availability of all required dependencies and packages on the new server.
- Have root or sudo access on both the old and new servers.
mysqldump -u root -p koha16 > /path/to/backup/koha16_backup.sql
Copy the Koha configuration files to a safe location:
cp -r /etc/koha /path/to/backup/koha_config/
Stop Koha and related services:
sudo systemctl stop apache2
sudo systemctl stop memcached
sudo systemctl stop koha-common
sudo apt update
sudo apt upgrade -y
Add the Koha repository for version 16.05:
echo "deb http://debian.koha-community.org/koha 16.05 main" | sudo tee /etc/apt/sources.list.d/koha.list
wget -q -O- http://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -
Install required packages, including specific versions of dependencies:
sudo apt update
sudo apt install fonts-dejavu-core fonts-dejavu-extra
wget http://archive.ubuntu.com/ubuntu/pool/universe/t/tinymce/tinymce_3.4.8+dfsg0-2_all.deb
sudo dpkg -i tinymce_3.4.8+dfsg0-2_all.deb
sudo apt-get install koha-common=16.05.19-1
Transfer the database backup and configuration files to the new server using scp or a similar method:
scp /path/to/backup/koha16_backup.sql user@new-server:/path/to/destination/
scp -r /path/to/backup/koha_config/ user@new-server:/path/to/destination/
On the new server, restore the Koha database:
mysql -u root -p koha16 < /path/to/destination/koha16_backup.sql
Move the configuration files to their appropriate locations:
sudo cp -r /path/to/destination/koha_config/ /etc/koha/
sudo chown -R koha-koha /etc/koha
Adjust the koha.conf file for Apache to reflect the new server's configuration:
sudo nano /etc/apache2/sites-available/koha.conf
sudo a2ensite koha.conf
sudo a2enmod rewrite ssl
sudo systemctl reload apache2
If you need SSL, update the SSL configuration:
sudo nano /etc/apache2/sites-available/koha-ssl.conf
Replace the existing certificates with the Let's Encrypt certificates:
SSLCertificateFile /etc/letsencrypt/live/koha16.yourdomain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/koha16.yourdomain.com/privkey.pem
sudo a2ensite koha-ssl.conf
sudo systemctl reload apache2
Restart Apache and Koha services:
sudo systemctl restart apache2
sudo systemctl restart koha-common
Test the Koha installation by accessing it via the web browser:
- OPAC: http://koha16.yourdomain.com
- Intranet: http://koha16.yourdomain.com:8080
koha-rebuild-zebra -v -f koha16
- Log Files: Check the logs if you encounter any issues:
tail -f /var/log/koha/koha16/opac-error.log
tail -f /var/log/koha/koha16/intranet-error.log
- Configuration Testing: Ensure Apache configuration is valid:
sudo apachectl configtest
This guide should cover the essential steps to successfully migrate your Koha 16.05 instance to a new server running Ubuntu 22.04 LTS.