Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Tue Apr 16, 2024 3:29 am
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: trunk upgrade
PostPosted: Sun Dec 14, 2008 11:58 am 
Offline

Joined: Fri Oct 27, 2006 6:17 pm
Posts: 161
how can upgrade the database (mysql) from previus 1.4 to the current 1.4?
this can make my day :S
the DB have 200 mb of data already filled, cdr, clients, tariff's, etc.
i'supossed that i'need is upgrade the structure, but ... i'm trying but without luck.

Cheers.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 14, 2008 5:12 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
To upgrade from an older revision of trunk you need to compare the old schema with the new and issue SQL commands to bring your old schema up-to-date.
First you need to consult the history for the file in question:
Code:
# svn log trunk/DataBase/mysql-5.x/UPDATE-a2billing-v1.3.4-to-v1.4.0-mysql.sql

------------------------------------------------------------------------
r1334 | rach | 2008-12-09 21:04:05 +0000 (Tue, 09 Dec 2008) | 1 line

Improve dashboard
------------------------------------------------------------------------
r1324 | areski | 2008-12-07 21:11:50 +0000 (Sun, 07 Dec 2008) | 1 line

enable dashboard by default
------------------------------------------------------------------------
r1323 | rach | 2008-12-07 20:22:48 +0000 (Sun, 07 Dec 2008) | 1 line

First draft of dashboard
------------------------------------------------------------------------
r1320 | areski | 2008-12-05 16:56:53 +0000 (Fri, 05 Dec 2008) | 1 line

update mysql script and Mysql Cluster script
<snip>
Let's assume I installed trunk at revision r1324 and I want to upgrade to today's r1340, I would:
Code:
# svn diff -r1324:1340 trunk/DataBase/mysql-5.x/UPDATE-a2billing-v1.3.4-to-v1.4.0-mysql.sql
This gives a 'diff' of all the changes between those revisions. I find it helpful to additionally use a graphical diff-viewer such as Kompare, Meld, or even A2B's trac.
Let's take that diff piece by piece:
Code:
@@ -1378,5 +1378,16 @@

INSERT INTO cc_config_group (group_title ,group_description) VALUES ... ;
INSERT INTO cc_config (config_title, ... )
-VALUES ( 'Enable cache in Call Report', 'dashboard_enabled', ... );
+VALUES ( 'Enable cache in Call Report', 'dashboard_enabled', ... );
Here the '-' and '+' at the start of the line indicate what was removed and what was added. You can see that the values of this INSERT command have changed. Before we execute the updated INSERT, we need to DROP the old row with:
Code:
mysql> DROP FROM cc_config WHERE config_key == 'dashboard_enabled';
mysql> INSERT INTO cc_config (config_title ,config_key ,config_value ,config_description,
config_valuetype ,config_group_id ,config_listvalues)
VALUES ( 'Enable cache in Call Report', 'dashboard_enabled',
'0', 'I you want enabled the dashboard on the home page.',
'1', '13', 'yes,no');
The remainder of the diff shows only additions, with no modifications, so all that is needed is to strip the initial '+' from each line before entering them into the SQL server:
Code:
mysql> INSERT INTO cc_config (config_title ,config_key ,config_value ,config_description,
    config_valuetype ,config_group_id ,config_listvalues)
    VALUES ( 'Enable info module about customers', 'customer_info_enabled', 'LEFT',
    'I you want enabled the info module customer and place it somewhere on the home page.',
    '0', '13', 'NONE,LEFT,CENTER,RIGHT');
etc.
If you're updating from a much older trunk there will be much more to do. You may find it easier to upgrade to each new revision individually, rather than try to perform it all in one go.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 14, 2008 11:47 pm 
Offline

Joined: Fri Oct 27, 2006 6:17 pm
Posts: 161
perfect, there are a lot of useful info, like always you give to the users.
now i'have another question, how can i'know what svn version i'have?

thx stavros.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 15, 2008 3:23 am 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
svn info


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 25, 2008 8:50 pm 
Offline

Joined: Fri Oct 27, 2006 6:17 pm
Posts: 161
i'think this its insane, the customer are using the "Revision: 624" and at the moment are on the svn 1361 revision.

maybe, can backup the customers, the cdr, tariff and do a reinstall, and import all.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 04, 2009 2:19 pm 
Offline

Joined: Fri Oct 27, 2006 6:17 pm
Posts: 161
how can do svn check for X version of the trunk?

edited : svn -r XXX


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 04, 2009 6:37 pm 
Offline

Joined: Fri Oct 27, 2006 6:17 pm
Posts: 161
why this give me one error?

Quote:
+
+
+
+
+DELIMITER //
+CREATE TRIGGER `a2billing`.`after_ins_cc_card` AFTER INSERT ON `a2billing`.`cc_card`
+ FOR EACH ROW begin
+
+
+ insert into cc_logrefill(credit,card_id,reseller_id) values(NEW.credit,NEW.id,NEW.reseller);
+ end
+//
+DELIMITER ;
+
+



Quote:
#1054 - Unknown column 'reseller' in 'NEW'


i'm extracting this using :

Quote:
svn diff -r624:688 trunk/DataBase/mysql-5.x/UPDATE-a2billing-v1.3.0-to-v1.4.0-mysql.sql


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2009 12:53 am 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
Are you entering the DELIMITER lines too? What version of MySQL are you running?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2009 3:00 am 
Offline

Joined: Fri Oct 27, 2006 6:17 pm
Posts: 161
the mysql is 5.0.45

i'think, is not possible todo a upgrade from a old version of 1.4 (624) to actual trunk, a lot of changes in the db, in the cc_call table are not compatible with the new 1.4 , the new have less rows, i'm doing this one and another time, and can't make the upgrade succesful :(

have some sugesstion?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2009 3:19 am 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
To the best of my knowledge there is no alternative to doing the steps I detailed above.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 
VoIP Billing solution


All times are UTC


Who is online

Users browsing this forum: No registered users and 0 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group