VIRTUALIZOR 2.7.9 TO 2.8.0 MANUAL UPDATE

Attention: open in a new window. PDFPrintE-mail

 

 

Firstly, every php-file in Virtualizor distribution is encrypted with IonCube. Secondly, initial database file (virtualizor.sql) doesn’t contains full schema. I’ve concluded that updating process is pretty hidden, but we can do this

1) ssh to host-node with your credentials
$ ssh [email protected]

2) check running services
$ ps aux | grep emps

3) switch to sudo session
$ sudo su

4) stop Virtualizor services
$ service virtualizor stop

5) backup your data
$ cd ~; mkdir backup
$ cp /usr/local/virtualizor/universal.php ~/backup # virtualizor config
$ cp /usr/local/virtualizor/license.php ~/backup # license
$ cp -r /usr/local/virtualizor/conf/ ~/backup # certs and system config
$ cp -r /usr/local/virtualizor/ ~/backup # whole folder in case of trouble

6) open universal.php and try to find lines (write somewhere)
$globals['dbhost'] # hostname for mysql server (in my case this is localhost)
$globals['db'] # database name inside mysql server (in my case this is virtualizor)
$globals['dbuser'] # user name to connect to mysql server
$globals['dbpass'] # password to connect to mysql server

this is the mysql-database settings that will help us to backup database

7) backup database (you have to enter $globals[‘dbpass’] value from universal.php in prompt)

$ /usr/local/emps/bin/mysqlctl start
$ /usr/local/emps/bin/mysqldump -u root -p virtualizor > ~/backup/backup.sql
$ /usr/local/emps/bin/mysqlctl stop

root – is $globals[‘dbuser’] value
virtualizor – is $globals[‘db’] value

8) download Virtualizor latest distribution
$ wget http://files.virtualizor.com/2.8.0.zip

9) purge old Virtualizor instance
$ rm -rf /usr/local/virtualizor/

10) install new instance
$ unzip 2.8.0.zip -d /usr/local/virtualizor

11) restore settings
$ cp ~/backup/universal.php /usr/local/virtualizor/ # virtualizor config
$ cp ~/backup/license.php /usr/local/virtualizor/ # license
$ cp -r ~/backup/conf/ /usr/local/virtualizor/ # certs and system config

12) fix permissions
$ chmod +x /usr/local/virtualizor/conf/emps/emps

13) import hidden schema
$ /usr/local/emps/bin/mysqlctl start
$ /usr/local/emps/bin/mysql -h localhost -u root -p virtualizor < hidden_schema_280.sql
$ /usr/local/emps/bin/mysqlctl stop

root – is $globals[‘dbuser’] value
virtualizor – is $globals[‘db’] value

14) start services and visit web-panel
$ service virtualizor start

15) if everything okay you can remove old instance backup
$ rm -rf ~/backup/virtualizor/

I’ve used this steps to successful upgrade to 2.8.0

You can grab hidden_schema_280.sql here:
http://pastebin.com/ZsmykD76

----------

use `virtualizor`;
ALTER TABLE `vps` ADD `disable_ebtables` INT(5) NOT NULL DEFAULT '0';
ALTER TABLE `vps` ADD `cpu_mode` VARCHAR(255) NULL DEFAULT NULL AFTER `io_mode`;
ALTER TABLE `plans` ADD `ploop` INT(2) NOT NULL DEFAULT '0';
ALTER TABLE `plans` ADD `upload_speed` INT(10) NOT NULL DEFAULT '0' AFTER `network_speed`;
ALTER TABLE `plans` ADD `band_suspend` INT(5) NOT NULL DEFAULT '0';
ALTER TABLE `plans` ADD `dns_nameserver` TEXT NULL DEFAULT NULL;
ALTER TABLE `plans` ADD `ppp` INT(10) NOT NULL DEFAULT '0';
ALTER TABLE `plans` ADD `tuntap` INT(10) NOT NULL DEFAULT '0';
ALTER TABLE `plans` ADD `control_panel` TEXT NOT NULL;
ALTER TABLE `plans` ADD `mgs` TEXT NULL DEFAULT NULL;
ALTER TABLE `plans` ADD `cpu_mode` VARCHAR(255) NULL;
ALTER TABLE `plans` ADD `sec_iso` TEXT NULL DEFAULT NULL;
ALTER TABLE `plans` ADD `hvm` INT(5) NOT NULL DEFAULT '0';
ALTER TABLE `plans` ADD `kvm_cache` VARCHAR(20) NOT NULL;
ALTER TABLE `plans` ADD `io_mode` VARCHAR(20) NOT NULL;
ALTER TABLE `plans` ADD `osreinstall_limit` INT(10) NOT NULL DEFAULT '0';
ALTER TABLE `plans` ADD `total_iops_sec` BIGINT(20) NOT NULL DEFAULT '0';
ALTER TABLE `plans` ADD `read_bytes_sec` BIGINT(20) NOT NULL DEFAULT '0';
ALTER TABLE `plans` ADD `write_bytes_sec` BIGINT(20) NOT NULL DEFAULT '0';
ALTER TABLE `plans` ADD `vnc_keymap` VARCHAR(20) NOT NULL ;
ALTER TABLE `plans` ADD `osid` INT(10) NOT NULL DEFAULT '0';
ALTER TABLE `plans` ADD `kvm_vga` INT(4) NOT NULL DEFAULT '0';
ALTER TABLE `plans` ADD `acceleration` INT(4) NOT NULL DEFAULT '0';
ALTER TABLE `plans` ADD `vif_type` VARCHAR(100) NOT NULL;
ALTER TABLE `plans` ADD `pv_on_hvm` INT(4) NOT NULL DEFAULT '0';
ALTER TABLE `plans` ADD `iso` TEXT NULL DEFAULT NULL;
ALTER TABLE `plans` ADD `vnc` INT(4) NOT NULL DEFAULT '0';
ALTER TABLE `admin_acl` ADD `act_iplogs` TINYINT(4) NOT NULL DEFAULT '0';
ALTER TABLE `admin_acl` ADD `act_deliplogs` TINYINT(4) NOT NULL DEFAULT '0';
ALTER TABLE `servers` ADD `vcores` INT(10) NOT NULL DEFAULT '0';
ALTER TABLE `servers` ADD `ips` INT(10) NOT NULL DEFAULT '0';
ALTER TABLE `servers` ADD `ipv6` INT(10) NOT NULL DEFAULT '0';
ALTER TABLE `servers` ADD `ipv6_subnet` INT(10) NOT NULL DEFAULT '0';
ALTER TABLE `servers` ADD `ips_int` INT(10) NOT NULL DEFAULT '0';
ALTER TABLE `servers` ADD `bandwidth` BIGINT(12) NOT NULL DEFAULT '0';
ALTER TABLE `servers` ADD `update_resource` TINYINT(2) NOT NULL DEFAULT '0' ;
REPLACE INTO `registry` SET `name` = 'version', `value` = '2.8.0';
--------------