Target users for this document
Users who are using SQLite with 1.0.0 and 1.0.1.
Affected area
The job manager (Pysilhouette)
Issue which was fixed in 1.0.2
Installer was causing the job manager (Pysilhouette) to lookup SQLite database path, even the user specified other database path (like MySQL or PostgreSQL), so multi-host configuration was not supported.
1.0.2 fixes these problems, but some manual configuration are needed for updates.
1. Database Creation
Create database for the job manager (Pysilhouette).
Example)
For PostgreSQL
# createdb -U username -W pysilhouette --encoding=utf8
For MySQL
# mysql -u username -p -e 'CREATE DATABASE pysilhouette DEFAULT CHARACTER SET utf8;'
Important)
Create database with UTF-8 charsets.
2. Download the new package and deploy.
# rm -rf Karesansui # tar zxvf karesansui-<version>-install-pack.tar.gz # cd Karesansui
3. Check current database path
Get current Pysilhouette database path.
sqlite:////var/opt/pysilhouette/pysilhouette.db
4. Update Karesansui
Update Karesansui and change Pysilhouette database path.
Update Karesansui as the steps in the tutorial
# ./karesansui-install
Uncheck "Initialize database", or you will lose your current database settings.
5. Installation Environment Check
Execute ./karesansui-checkenv to check if there are any errors.
Check if the output message "Checking whether we are able to connect to database for XXXXX... " describes your new database path.
# ./karesansui-checkenv
6. Migrate Database
Copy SQLite database to MySQL or PostgreSQL database.
# cd /opt/pysilhouette/share/doc/pysilhouette-0.6.2/tool/ # export PYTHONPATH=/opt/hde/lib/python:/opt/karesansui/lib/python:/opt/pysilhouette/lib/python:$PYTHONPATH # ./sqlite2other.py --input=<old database path> --output=<new database path>
SQLite : sqlite:////var/opt/karesansui/pysilhouette.db MySQL : mysql://username:password@hostname:port/pysilhouette?charset=utf8 PostgreSQL : postgres://username:password@hostname:port/pysilhouetteWarning)
Take a memo of the outputted "copy num" number. We use it later. (copy num - xxx) sqlite2other.py only supports SQLite -> MySQL or SQLite -> PostgreSQL migration.Example)
# ./sqlite2other.py --input=sqlite:////var/opt/pysilhouette/pysilhouette.db --output=mysql://username:password@localhost/pysilhouette?charset=utf8 Cleanup Database [OK] copy num - 3
Information)
For details about database path format, consult the reference
7. Change Auto Increment Counter Value
Change the auto increment counter value of Pysilhouette.
Access Pysilhouette database an execute the SQL below.
Put the "copy-num" value we got above into <copy num value>.
For PostgreSQL:
select setval('jobgroup_id_seq', <copy num value>);
select setval('job_id_seq', <copy num value>);
Example)
# psql pysilhouette -U username -h localhost -c "select setval('jobgroup_id_seq', 3);"
# psql pysilhouette -U username -h localhost -c "select setval('job_id_seq' 3);"
For MySQL:
ALTER TABLE jobgroup AUTO_INCREMENT = <copy num value>;
ALTER TABLE job AUTO_INCREMENT = <copy num value>;
Example)
# mysql pysilhouette -u username -h localhost -p -e "ALTER TABLE jobgroup AUTO_INCREMENT = 3;"
# mysql pysilhouette -u username -h localhost -p -e "ALTER TABLE job AUTO_INCREMENT = 3;"
Information)# ./sqlite2other.py --input=<old database path> --output=<new database path> Cleanup Database [OK] copy num - 3 <-- "copy-num" value
# /etc/init.d/hde-lighttpd stop # /etc/init.d/silhouetted restart # /etc/init.d/hde-lighttpd start
In version 1.1, the path of some configuration files and disk image files has changed.
This document describes how to migrate these files and settings.
_*We recommend to back up the important data to other physical machine in advance.*_
1. Stop Daemon
Stop the daemon processes.# /etc/init.d/silhouetted stop # /etc/init.d/hde-lighttpd stop # /etc/init.d/hde-libvirtd stop # /etc/init.d/xend stop
2. Download the new package and deploy.
# rm -rf Karesansui # tar zxvf karesansui-<version>-install-pack.tar.gz # cd Karesansui
3. Update Karesansui
# ./karesansui-install
_*You must not choise the database initialization.*_
4. Installation Environment Check
Execute ./karesansui-checkenv to check if there are any errors.
# ./karesansui-checkenv