Page 1 of 1
Database problem after HW migration
Posted:
Sun Jun 23, 2013 4:17 pm
by haz
Hello all!
I have posted before related to hardware migration i was planing to do. Now after doing the migration and restoring from the backups the system database is showing strange symptoms.
In short both lists and filters tabs are not seen in the GUI, system settings tab is having all fields empty and even if creating a new campaign works yet the campaign detailed view shows many empty fields.
Any ideas or possible trouble shooting tips?
the long version here:
1- the old hardware was having this configuration:
Vicibox 4.0.3 from ViciBox.x86_64-4.0.3.preload.iso | VERSION: 2.6-394a, BUILD: 130130-1207 | Asterisk 1.4.44-vici | Single Server |no hardware modules.
very basic configuration where we basically configured phones, users, campaign, one carrier and we are using the system to dial out manually for now.
2- I did run the ADMIN_backup script with the debugX, all files moved using FTP to an external USB memory.
3- We made an installation from a preload iso to the new machine as follows:
Vicibox 4.0.3 from ViciBox.x86_64-4.0.3.preload.iso | VERSION: 2.6-394a, BUILD: 130130-1207 | Asterisk 1.4.44-vici | Single Server | RAID Adaptec 2405| No Digium/Sangoma Hardware | No Extra Software After Installation | Intel Xeon | E3-1220 3.1Ghz 4 cores (HP ML310e Gen8)
Straight forward installation using the express mode ofcourse linux updates were performed.
4- The Backup files from the old server were restored into the new installation. Both configuration files and the database files then a system reboot.
5- At first glanced it seemed that things were working as xlite worked we could login to the admin gui but then we realised the missing things mentioned above.
Any one that can help on this issue.
Regards
Haz
Re: Database problem after HW migration
Posted:
Mon Jun 24, 2013 5:11 am
by DomeDan
look in /var/log/apache2/error_logs and write the errors here if there is any
Re: Database problem after HW migration
Posted:
Mon Jun 24, 2013 10:34 am
by haz
hello DomeDam and all!
Here comes the apache error_log from today:
[Mon Jun 24 17:11:49 2013] [error] [client 192.168.0.26] PHP Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /srv/www/htdocs/vicidial/admin.php on line 1873, referer:
http://192.168.0.50/vicidial/admin.php?ADD=999998[Mon Jun 24 17:11:49 2013] [error] [client 192.168.0.26] PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /srv/www/htdocs/vicidial/admin_header.php on line 1064, referer:
http://192.168.0.50/vicidial/admin.php?ADD=999998[Mon Jun 24 17:11:51 2013] [error] [client 192.168.0.26] PHP Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /srv/www/htdocs/vicidial/admin.php on line 1873, referer:
http://192.168.0.50/vicidial/admin.php?ADD=100000000000[Mon Jun 24 17:11:51 2013] [error] [client 192.168.0.26] PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /srv/www/htdocs/vicidial/admin_header.php on line 1064, referer:
http://192.168.0.50/vicidial/admin.php?ADD=100000000000[Mon Jun 24 17:12:08 2013] [error] [client 192.168.0.26] PHP Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /srv/www/htdocs/vicidial/admin.php on line 1873, referer:
http://192.168.0.50/vicidial/admin.php? ... id=Talksrv[Mon Jun 24 17:12:08 2013] [error] [client 192.168.0.26] PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /srv/www/htdocs/vicidial/admin_header.php on line 1064, referer:
http://192.168.0.50/vicidial/admin.php? ... id=Talksrv[Mon Jun 24 17:12:08 2013] [error] [client 192.168.0.26] PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /srv/www/htdocs/vicidial/admin.php on line 32409, referer:
http://192.168.0.50/vicidial/admin.php? ... id=Talksrv
Re: Database problem after HW migration
Posted:
Tue Jun 25, 2013 4:55 am
by DomeDan
Its Dan, not Dam
To bad the code didn't include mysql_error()
the "expects parameter 1 to be resource, boolean given in" stuff means in this case that the query failed for some reason,
my guess is that it failed because of missing columns
so either the mysql import failed and you only got some of the data
or you provided us with the wrong information, are you 100% sure that the old setup was:
VERSION: 2.6-394a, BUILD: 130130-1207 ?
and that the new is:
VERSION: 2.6-394a, BUILD: 130130-1207
you used the same iso-file: ViciBox.x86_64-4.0.3.preload.iso for both installs?
and no upgrade was done?
and you didn't run any upgrade_2.X.sql-file or something like that?
do you know what database schema you used in the old setup and what schema you are using now?
Re: Database problem after HW migration
Posted:
Tue Jun 25, 2013 5:34 am
by haz
Hello !
OK sorry for miss-typing your name.
As usual you are right and now after checking the new version is:
VERSION: 2.8-403a, BUILD: 130510-1350. (100% sure as this is what i see in the machine
And the version in the old machine is: VERSION: 2.6-394a, BUILD: 130130-1207. (not sure for now but will check as soon as i get the old machine running)
I am sure that i used the vicibox.x86_64 preload iso.
i did not run any upgrade command.
the database shcema in the new machine is an empty field.
So if the versions are wrong then you mean i have to downgrade first and then restore the database or what do you mean?
Re: Database problem after HW migration
Posted:
Tue Jun 25, 2013 5:42 am
by DomeDan
The reason its empty is probably because it fails to get the data with the query it uses.
you need only to upgrade the database schema to get it working.. hopefully:
mysql -v -uroot -p < upgrade_2.8.sql
the file is probably here in your system: /usr/src/astguiclient/trunk/extras/upgrade_2.8.sql
Re: Database problem after HW migration
Posted:
Tue Jun 25, 2013 6:52 am
by haz
Ok i will try that and i am assuming that i have to shutdown apache and asterisk before doing this, am I right?
Re: Database problem after HW migration
Posted:
Tue Jun 25, 2013 7:01 am
by DomeDan
I don't think you need that, the database will be altered anyway and when you refresh the webpage it will either work as it should.. or not
Re: Database problem after HW migration
Posted:
Tue Jun 25, 2013 7:54 am
by haz
Well i have executed the command mysql -v -uroot -p < upgrade_2.8.sql on asterisk database without restarting or stopping the webserver or asterisk server and IT DID NOT fix that problem.
I will try to restart the system when i do not have users connected and iform you.
Re: Database problem after HW migration
Posted:
Tue Jun 25, 2013 8:32 am
by DomeDan
Is it a running system?
well well..
you can't run that command anywhere, upgrade_2.8.sql is a
file!
I don't even know if you have it, it might be here /usr/src/astguiclient/trunk/extras/upgrade_2.8.sql
- Code: Select all
ls /usr/src/astguiclient/trunk/extras/upgrade_2.8.sql
# did you get info about the file like this:
# -rw-r--r-- 1 root root 13045 Feb 8 16:00 /usr/src/astguiclient/trunk/extras/upgrade_2.8.sql
# then you know its there, and you can try to run it:
mysql -v -uroot -p < /usr/src/astguiclient/trunk/extras/upgrade_2.8.sql
Re: Database problem after HW migration
Posted:
Tue Jun 25, 2013 9:40 am
by haz
I have found the file and then run that command from that folder and i got messages saying that it was executed.
However the mysql command complained about no database selected. Then i did select asterisk database and run the command and then got some output text.
I belive that i have executed the command but then i will try to restart the machine and may be rerun the command when the system is not being used.
Re: Database problem after HW migration
Posted:
Tue Jun 25, 2013 10:06 am
by DomeDan
ah yeah, forgot that, you need to specify the asterisk database, like this I think:
mysql -v -uroot -p asterisk < /usr/src/astguiclient/trunk/extras/upgrade_2.8.sql
Re: Database problem after HW migration
Posted:
Tue Jun 25, 2013 10:30 am
by haz
I did that and then restarted the machine, rebuild config files and still the same thing.
ANy more ideas as i am starting to give up.
Re: Database problem after HW migration
Posted:
Wed Jun 26, 2013 2:36 am
by DomeDan
* what was the output when you run the mysql command?
* maybe you need to run upgrade_2.6.sql first too
Re: Database problem after HW migration
Posted:
Wed Jun 26, 2013 4:03 am
by haz
Hello DomeDan!
Thanks for all your help and support related to this issue.
Yesterday night i had access to the old system and i discovered that the DB schema was 1340. Then i searched the forum and found a thread from william where he described how to upgrade.
Starting with dropping the asterisk database and then creating it and then following the upgrade dokument.
I made a new backup of the old machine and then restored using this backup according to the upgrade document "UPGRADE" and then things wokred at around 01:00 this morning.
I need to make some more tests this evening to make sure that everything is up and running.
Regards
HAZ
Re: Database problem after HW migration
Posted:
Thu Dec 22, 2016 1:58 pm
by Hakim.amza
after svn update i don't have any data and i have got this error WARNING: Code expects different schema: 1483 in admin>systems settings
Help plz
Re: Database problem after HW migration
Posted:
Thu Dec 22, 2016 5:06 pm
by mflorell
You have to follow the upgrade steps in the UPGRADE document.