Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Mar 28, 2024 12:18 pm
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: How to restore from corrupted DB?
PostPosted: Sat Mar 13, 2010 2:32 am 
Offline

Joined: Sun May 17, 2009 8:04 am
Posts: 115
Hi Guys,
Got a tricky one here.

I have ver 1.4 up and running in production and most of the features work great. However i'm unable to get DID inbound stuff working and i get high cpu issues in mysql with some of the options for the rates etc. So basically my DB is corrupted somehow. I've tried repairing tables etc but no difference. With a fresh install of 1.6 on another server its all great but as soon as I copy the prod database to the new one it craps out with all the old issues again.

What's my best option for rebuilding to a fresh install of say 1.6 without loosing all the call records and the 12000 rates i have in there?

One option i thought of doing was to run a slave server off the Production one and point the customers to that for call records then build the new 1.6 database from scratch break the master slave replication and then start it working from the new database and recreate the replication and hopefully i'll get all the old call records on the slave for the customers plus the new records off the new DB. However this will take some time as i'll need to reload all the rates and clients again.

My question is - Is there an easier way of doing this?

Grateful for the info.

Thanks,
Taff..


Top
 Profile  
 
 Post subject: Re: How to restore from corrupted DB?
PostPosted: Sat Mar 13, 2010 10:45 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

Just take a copy of the existing database, and run the update scripts on it.

Joe


Top
 Profile  
 
 Post subject: Re: How to restore from corrupted DB?
PostPosted: Sat Mar 13, 2010 10:47 am 
Offline

Joined: Sun May 17, 2009 8:04 am
Posts: 115
Yeah i tried that but got heaps of errors with duplicates etc..


Top
 Profile  
 
 Post subject: Re: How to restore from corrupted DB?
PostPosted: Sat Mar 13, 2010 10:52 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

The first job is to identify the version of the database, then you need to run the subsequent updates.

However, if you have done this and you are getting duplicates, I'm afraid it is going to get very manual. Open the update scripts in turn, and inspect them and run them manually on by one, because if there is a failure, then the rest of the script is not run.

Joe


Top
 Profile  
 
 Post subject: Re: How to restore from corrupted DB?
PostPosted: Sat Mar 13, 2010 10:58 am 
Offline

Joined: Sun May 17, 2009 8:04 am
Posts: 115
Here is an example:

[root@maindb mysql-5.x]# mysql -u root -p mya2billing < UPDATE-a2billing-v1.3.4-to-v1.4.0.sql
Enter password:
ERROR 1050 (42S01) at line 61: Table 'cc_invoice' already exists
[root@maindb mysql-5.x]# mysql -u root -p mya2billing < UPDATE-a2billing-v1.4.0-to-v1.4.1.sql
Enter password:
ERROR 1091 (42000) at line 43: Can't DROP 'currency'; check that column/key exists
[root@maindb mysql-5.x]# mysql -u root -p mya2billing < UPDATE-a2billing-v1.4.1-to-v1.4.2.sql
Enter password:
ERROR 1050 (42S01) at line 34: Table 'cc_message_agent' already exists
[root@maindb mysql-5.x]# mysql -u root -p mya2billing < UPDATE-a2billing-v1.4.2-to-v1.4.3.sql
Enter password:
ERROR 1061 (42000) at line 34: Duplicate key name 'idtariffplan_index'
[root@maindb mysql-5.x]# mysql -u root -p mya2billing < UPDATE-a2billing-v1.4.3-to-v1.4.4.sql
Enter password:
ERROR 1050 (42S01) at line 35: Table 'cc_callplan_lcr' already exists
[root@maindb mysql-5.x]# mysql -u root -p mya2billing < UPDATE-a2billing-v1.4.4.1-to-v1.4.5.sql
Enter password:
ERROR 1060 (42S21) at line 73: Duplicate column name 'agent_id'
[root@maindb mysql-5.x]# mysql -u root -p mya2billing < UPDATE-a2billing-v1.4.5-to-v1.5.0.sql
Enter password:
[root@maindb mysql-5.x]# mysql -u root -p mya2billing < UPDATE-a2billing-v1.5.0-to-v1.5.1.sql
Enter password:
[root@maindb mysql-5.x]# mysql -u root -p mya2billing < UPDATE-a2billing-v1.5.1-to-v1.6.0.sql
Enter password:
ERROR 1146 (42S02) at line 34: Table 'mya2billing.cc_subscription_fee' doesn't exist
[root@maindb mysql-5.x]# mysql -u root -p mya2billing < UPDATE-a2billing-v1.6.0-to-v1.6.1.sql
Enter password:
[root@maindb mysql-5.x]# mysql -u root -p mya2billing < UPDATE-a2billing-v1.6.1-to-v1.6.2.sql
Enter password:

So in each Update file will i have to remove the duplicate lines or ones with errors?


Top
 Profile  
 
 Post subject: Re: How to restore from corrupted DB?
PostPosted: Sat Mar 13, 2010 11:16 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

Open each file, and copy and paste the individual SQL commands in one by one.

Joe


Top
 Profile  
 
 Post subject: Re: How to restore from corrupted DB?
PostPosted: Sat Mar 13, 2010 11:23 am 
Offline

Joined: Sun May 17, 2009 8:04 am
Posts: 115
Ok i'll give that a go.

Cheers...


Top
 Profile  
 
 Post subject: Re: How to restore from corrupted DB?
PostPosted: Sat Mar 13, 2010 9:10 pm 
Offline

Joined: Sun May 17, 2009 8:04 am
Posts: 115
Ok that worked a treat for the inbound DID. Now running 1.6.2

The only issue i have left is that when i click on the rates tab under RATES the mysql DB shoots up to 100% cpu and i have to restart the service. No data is presented. Now in ver 1.4.1 i have no issues with it.

Anything i can look at to find this issue? Otherwise i have to keep rolling back to change the rates..


Top
 Profile  
 
 Post subject: Re: How to restore from corrupted DB?
PostPosted: Sat Mar 13, 2010 10:30 pm 
Offline

Joined: Sun May 17, 2009 8:04 am
Posts: 115
I get the same issue with the ratecard in the customer portal as well. If i click on it mysql jumps to 100% cpu..


Top
 Profile  
 
 Post subject: Re: How to restore from corrupted DB?
PostPosted: Wed May 05, 2010 4:35 am 
Offline

Joined: Thu May 15, 2008 2:02 am
Posts: 115
hello iam trying to update the data base but iam getting the duplicated error, even when i run one by one command in mysql.

mysql -u root -p mya2billing < UPDATE-a2billing-v1.4.1-to-v1.4.2.sql
Enter password:
ERROR 1050 (42S01) at line 34: Table 'cc_message_agent' already exists

mysql> CREATE TABLE cc_message_agent (
-> id BIGINT NOT NULL AUTO_INCREMENT ,
-> id_agent INT NOT NULL ,
-> message LONGTEXT CHARACTER SET utf8 COLLATE utf8_bin NULL ,
-> type TINYINT NOT NULL DEFAULT '0' ,
-> logo TINYINT NOT NULL DEFAULT '1',
-> order_display INT NOT NULL ,
-> PRIMARY KEY ( id )
-> ) ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
ERROR 1050 (42S01): Table 'cc_message_agent' already exists
mysql>


there is anything else that i need to do?

thank you for your help.


Top
 Profile  
 
 Post subject: Re: How to restore from corrupted DB?
PostPosted: Tue Sep 06, 2011 8:37 pm 
Offline

Joined: Tue Sep 06, 2011 8:35 pm
Posts: 1
taffey01 wrote:
Ok that worked a treat for the inbound DID. Now running 1.6.2

The only issue i have left is that when i click on the rates tab under RATES the mysql DB shoots up to 100% cpu and i have to restart the service. No data is presented. Now in ver 1.4.1 i have no issues with it.

Anything i can look at to find this issue? Otherwise i have to keep rolling back to change the rates..


Given situation may be solved with the aid mysql recovery, which owns many different capabilities for settling out almost every trouble associated with mysql server files.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 
Voice Broadcast System


All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group