Database problem after HW migration

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Database problem after HW migration

Postby haz » Sun Jun 23, 2013 4:17 pm

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
haz
 
Posts: 44
Joined: Mon Feb 11, 2013 7:59 am

Re: Database problem after HW migration

Postby DomeDan » Mon Jun 24, 2013 5:11 am

look in /var/log/apache2/error_logs and write the errors here if there is any
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: Database problem after HW migration

Postby haz » Mon Jun 24, 2013 10:34 am

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
haz
 
Posts: 44
Joined: Mon Feb 11, 2013 7:59 am

Re: Database problem after HW migration

Postby DomeDan » Tue Jun 25, 2013 4:55 am

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?
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: Database problem after HW migration

Postby haz » Tue Jun 25, 2013 5:34 am

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?
haz
 
Posts: 44
Joined: Mon Feb 11, 2013 7:59 am

Re: Database problem after HW migration

Postby DomeDan » Tue Jun 25, 2013 5:42 am

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
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: Database problem after HW migration

Postby haz » Tue Jun 25, 2013 6:52 am

Ok i will try that and i am assuming that i have to shutdown apache and asterisk before doing this, am I right?
haz
 
Posts: 44
Joined: Mon Feb 11, 2013 7:59 am

Re: Database problem after HW migration

Postby DomeDan » Tue Jun 25, 2013 7:01 am

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 :)
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: Database problem after HW migration

Postby haz » Tue Jun 25, 2013 7:54 am

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.
haz
 
Posts: 44
Joined: Mon Feb 11, 2013 7:59 am

Re: Database problem after HW migration

Postby DomeDan » Tue Jun 25, 2013 8:32 am

Is it a running system? :shock: 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
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: Database problem after HW migration

Postby haz » Tue Jun 25, 2013 9:40 am

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.
haz
 
Posts: 44
Joined: Mon Feb 11, 2013 7:59 am

Re: Database problem after HW migration

Postby DomeDan » Tue Jun 25, 2013 10:06 am

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
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: Database problem after HW migration

Postby haz » Tue Jun 25, 2013 10:30 am

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.
haz
 
Posts: 44
Joined: Mon Feb 11, 2013 7:59 am

Re: Database problem after HW migration

Postby DomeDan » Wed Jun 26, 2013 2:36 am

* what was the output when you run the mysql command?

* maybe you need to run upgrade_2.6.sql first too
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: Database problem after HW migration

Postby haz » Wed Jun 26, 2013 4:03 am

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
haz
 
Posts: 44
Joined: Mon Feb 11, 2013 7:59 am

Re: Database problem after HW migration

Postby Hakim.amza » Thu Dec 22, 2016 1:58 pm

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
Hakim.amza
 
Posts: 8
Joined: Fri May 13, 2016 12:26 pm

Re: Database problem after HW migration

Postby mflorell » Thu Dec 22, 2016 5:06 pm

You have to follow the upgrade steps in the UPGRADE document.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to Support

Who is online

Users browsing this forum: No registered users and 42 guests