Sniffer upgrade: Difference between revisions
(Created page with "= Upgrade from 5.1 = Since version 5.1 database is upgraded and populated automatically during first run (if mysql credential is set properly – CREATE and ALTER is needed). ...") |
No edit summary |
||
Line 1: | Line 1: | ||
= generic upgrade to the latest snapshot versions = | |||
killall -9 voipmonitor | |||
cd /usr/local/sbin | |||
rm voipmonitor | |||
wget http://www.voipmonitor.org/downloads/snapshots/current/voipmonitor | |||
chmod +x voipmonitor | |||
/etc/init.d/voipmonitor start | |||
= Upgrade from 5.1 = | = Upgrade from 5.1 = | ||
Since version 5.1 database is upgraded and populated automatically during first run (if mysql credential is set properly – CREATE and ALTER is needed). | Since version 5.1 database is upgraded and populated automatically during first run (if mysql credential is set properly – CREATE and ALTER is needed). |
Revision as of 08:55, 8 October 2013
generic upgrade to the latest snapshot versions
killall -9 voipmonitor cd /usr/local/sbin rm voipmonitor wget http://www.voipmonitor.org/downloads/snapshots/current/voipmonitor chmod +x voipmonitor /etc/init.d/voipmonitor start
Upgrade from 5.1
Since version 5.1 database is upgraded and populated automatically during first run (if mysql credential is set properly – CREATE and ALTER is needed).
Upgrade from 5.0 to 5.1
Upgrading database from 5.0 do not changes cdr table and thus the upgrade is instant. Here is the procedure Download voipmonitor sources and untar
wget https://sourceforge.net/projects/voipmonitor/files/5.1/voipmonitor-5.1-src.tar.gz/download
Go to voipmonitor source directory and run this command
cat cdrtable.sql.5.0-5.1 | mysql voipmonitor
Where voipmonitor is name of the database. If you have password protected database, run
cat cdrtable.sql.5.0-5.1 | mysql -p voipmonitor
Upgrade from 4.2 to 5.0
Database schema has changed in version 4 in way that it needs to alter table at least two times which is so inefficient that we had to write PHP script which transforms old CDR into new structure. On SATA disk upgrading 12 milions CDR takes ~24 hours which means that the table is also locked and no CDR is possible to write during the upgrade procedure. The procedure is:
#create new database mysqladmin create voipmonitor5 cat cdrtable.sql | mysql voipmonitor5 cd voipmonitor/scripts
#edit mysql_copy_4.2to5.0.php and set appropriate constants: define("HOST", "localhost"); define("USER", "root"); define("PASS", ""); define("SOURCE_DB", "voipmonitor"); define("DEST_DB", "voipmonitor5"); #SOURCE_DB is the old database name, DEST_DB is the new database.
- Run the script php mysql_copy_4.2to5.0.php
The script can run for very long time so its recommended to run it from “screen” (apt-get install screen | yum install screen). The speed of conversion depends a lot on two factors - if binlog is enabled it is better to disable it in /etc/mysql/my.cn (comment out log_bin) in /etc/mysql/my.cnf set innodb_flush_log_at_trx_commit = 0 (and after you finish the upgrade, set it to = 2 (more secure) If disk is raid5 or slow SATA disk, insertion would be very slow. If the disk with mysql is shared with /var/spool/voipmonitor and voipmonitor sniffer is running - In this case stop mysql, mv /var/lib/mysql /mnt/dedicated/; mkdir /var/lib/mysql; chown mysql /var/lib/mysql; mount -o bind /mnt/dedicated/mysql /var/lib/mysql – and start mysql. After you finish export you can move all files back (do not forget to keep right permission on the files - user mysql).