1. ### How to upgrade your existing Shockvoice Mysql database ###
2. ### How to upgrade you existing Shockvoice Sqlite database ###
3. ### How to install a Shockvoice server on Linux using Mono ###

1. ### How to upgrade your existing Shockvoice Mysql database ###
PLEASE UPDATE YOUR EXISTING DATABASE FIRST!!
shell> cd <path to your installation>
shell> mysql -u<your-svuser> -p <your-svdatabase> < sv093_update.mysql.sql
e.g. mysql -uroot -p shockvoice < sv093_update.mysql.sql

2. ### How to upgrade you existing Shockvoice Sqlite database ###
PLEASE UPDATE YOUR EXISTING DATABASE FIRST!!
We recommend to use an sqlite administration tool. But anyways here is the shell command
shell> sqlite3 <yourdatabasename> < sv093_update.sqlite.sql 
e.g. sqlite3 shockvoice.s3db < sv093_update.sqlite.sql

3. ### How to install a Shockvoice server on Linux using Mono ###
First of all you need the latest version of the .NET interpreter for Linux called Mono. Get the latest one from:

http://www.go-mono.com/mono-downloads/download.html

If your system is not listed you can download a complete binary package which can be found here:

http://www.mono-project.com/Other_Downloads

Alternativ you can compile the latest Mono sources yourself. Mono-2.4.x needs libgdiplus-2.4.x

Download from:

shell> wget http://ftp.novell.com/pub/mono/sources/libgdiplus/libgdiplus-2.4.2.tar.bz2

shell> wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.4.2.3.tar.bz2


shell> tar xjf libgdiplus-2.4.2.tar.bz2

shell> cd libgdiplus-2.4.2

shell> ./configure

shell> make

shell> make install


shell> tar xjf mono-2.4.2.3.tar.bz2

shell> cd mono-2.4.2.3

see the README for more compiling informations

shell> ./configure --prefix=/opt/mono

Depending on what packages are already installed you may need some more. On a Debian minimal installation you need to following packages:

shell> apt-get install bison gettext make gcc libgdiplus libglib2.0-0 pkg-config bzip2

shell> make

shell> make install


Follow the instructions on the screen. In our case we will install the binary to /opt. Once Mono is installed we need to get the latest server version of Shockvoice. Download the latest version from the Shockvoice downloadserver:

http://www.shockvoice.net/page/getsv


In our case we will download the Linux Server Version 0.9.0. 
Create the directory where you want to install Shockvoice.

shell> mkdir -p /usr/share/shockvoice

Download the package:

Unpack the package into the newly created directory:

shell> tar -C /usr/share/shockvoice -xvzf svserver-0.9.0beta-linux-community.tar.gz


Before we run the install.sh script need to know what database we want to use. In this example we choose MySQL as our favorite database. We have to do some stuff before that. If you want to use Sqlite as your database you have to use the shockvoice.s3db file as your database. If you intend to use MySQL you have to import the sql file into your database server.

Create the database:

shell> mysqladmin -uroot -p create shockvoice


Now import the tables to the database.

shell> mysql -uroot -p shockvoice < /usr/share/shockvoice/shockvoice.mysql.sql


Now we need to create a database user (we will name him svuser) and grant him permissions to use the Shockvoice database.

shell> mysql -uroot -p Enter Password:

mysql> GRANT USAGE ON shockvoice.* TO svuser@localhost IDENTIFIED BY '<yourpassword>';

mysql> GRANT ALL ON shockvoice.* TO svuser@localhost IDENTIFIED BY "<yourpassword>";

mysql> FLUSH PRIVILEGES;


Change to the directory and start the install.sh script.

shell> cd /usr/share/shockvoice && ./install.sh


Follow the instructions on the screen.
This script will create and configure the service_start, service_stop and the config.xml file.
It will try to locate the necessary files from your Mono installation
Please make sure you have mono installed before running this script.

Continue? (Y/n): y
Do you have unpacked Shockvoice in /home/kobayashi? (Y/n): y
Do you want to create the service_start and service_stop file? (recommend) (Y/n): y
Searching for mono...

0) /opt/mono-2.4.2.3/bin/mono Version: 2.4.2.3
1) /usr/local/bin/mono Version: 2.2

Which Version do you want to use (0-1)? 0

Found mono binary in /opt/mono-2.4.2.3/bin/mono .. good

Locating mono-service.exe...

0) found /opt/mono-2.4.2.3/lib/mono/gac/mono-service/2.0.0.0__0738eb9f132ed756/mono-service.exe
1) found /usr/local/lib/mono/gac/mono-service/2.0.0.0__0738eb9f132ed756/mono-service.exe

Hint: Mono and mono-service.exe should be from the same version!
Which version do you want to use (0-1)? 0

Applying mono-service.exe... good
Creating startscript
Creating stopscript
Do you want to create the config.xml file? (Y/n): y


Creating config.xml
Please enter type of database you want to use. (e.g. sqlite, mysql or postgres):

1. SQLite
2. MySQL
3. PostgreSQL
0. Exit

Choose: 2
Please enter server which stores the MySQL database for Shockvoice. (e.g. localhost): localhost
Please enter name of MySQL database: shockvoice
Please enter username who connects to the database: svuser
Please enter password for database user: (*hidden*)

Database type: MySQL
Database server: localhost
Database name: shockvoice
Database user: svuser
Database password: *hidden*
Is this Correct? (Y/n): y

Remember to setup the MySql database and User!

Configfile created!

Use service_start to start the Shockvoice server.


If you get an error like '==: unexpected operator' try changing the first line of the install.sh script to

shell> #!/bin/bash


Note: If you are not so familiar with MySQL you can use SQlite3 as your database Backend.
Please enter type of database you want to use. (e.g. sqlite, mysql or postgres): 

1. SQLite
2. MySQL
3. PostgreSQL
0. Exit

Choose: 1
Please enter name of SQLite database: (e.g. shockvoice.s3db) shockvoice.s3db


Database type: SQLite
Database name: shockvoice.s3db
Is this Correct? (Y/n): y

Do you intend to use the SOAP interface for remote administration?
Choose 'Yes' to enable the webservice on http://localhost:8080 otherwise choose no here. (y/N): n
Webservice disabled!

Configfile created!

Use service_start to start the Shockvoice server.

That's it. Now start the server with

shell> ./service_start



##Compile Mono on Debian Lenny##

apt-get install build-essential pkg-config gettext libglib2.0-dev bison make gcc libgdiplus libglib2.0-0 bzip2

cd /usr/src

wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.4.2.3.tar.bz2

bzip2 -d mono-2.4.2.3.tar.bz2

tar xf mono-2.4.2.3.tar

cd mono-2.4.2.3

./configure --prefix=/opt/mono/

make

make install 

