Upgrading a2billing v.1.2.3 to v.1.3.0 including production boxes
Most of this document has been copied from SureTeq document to upgrade an older version of a2billing and the install guide. Hope they don’t mind and I thank them for producing it. It saves so much time. Thank you.
I have tested this upgrade several times and was able to restore my data. Having said that I will not be responsible for data loss. If you have any type of problem which you should not, you can always go back to your original version and upload your data the same way.
Download latest A2Billing tar file
Create an a2billing directory.
mv /usr/src/a2billing a2billing_old (if you had this directory before)
mkdir /usr/src/a2billing
cd /usr/src/a2billing
Go to
http://trac.asterisk2billing.org/cgi-bin/trac.cgi and scroll to the bottom. There will be a link for downloading the latest version. I typically prefer to use wget, but I wasn't able to figure out the direct link to the file as the web page uses php to grab it. So I downloaded it to my local computer (which has an FTP server) and then FTP'd the file to /usr/src of my Linux box. You can also use WinSCP3 is an excellent program to work between you local Windows and your linux box. (look for the file you need)
Download the a2billing tar file to the a2billing directory you just created.
Once the file has been downloaded to your /usr/src/a2billing directory open your Linux CLI and do the following:
cd /usr/src/a2billing
tar zxvf A2Billing_1.3.0.tar.gz
Go to your a2billing program and do a backup of your data file with the Administrator => database backup. The backup will be placed in the /tmp directory.
Update your DataBase to V1.3.0 (or current version)
cd /usr/src/a2billing/DataBase/mysql/Mysql-5.x
mysql -u root -ppassw0rd mya2billing < UPDATE-a2billing-v1.2.3-to-v1.3.0-mysql.sql
if you get an error using the password then use your DB password or the same statement without the password command as follows.
mysql -u root mya2billing < UPDATE-a2billing-v1.2.3-to-v1.3.0-mysql.sql
Done! Your a2b v1.2.3 database has been converted to v1.3.0!
Install HTTP UI
The following commands will make a copy of your old UI and copy the new UI in its place.
Keep in mind sometimes the (–) in front of the R or r in the chown statement do not transfer when you copy and paste so fix it by hand. Keep in mind the upper and lower case in directory names so you can call the application correctly later.
cd /var/www/html
mv a2billing_UI a2billing_UI_old
mkdir a2billing_UI
chown –R asterisk:asterisk a2billing_UI
cd a2billing_UI
cp -r /usr/src/a2billing/A2Billing_UI/. . (include last two dots)
chmod 777 /var/www/html/a2billing_UI/templates_c
Install Customer console:
cd /var/www/html
mv a2bcustomer_UI a2bcustomer_UI_old
mkdir a2bcustomer_UI
chown –R asterisk:asterisk a2bcustomer_UI
cd a2bcustomer_UI
cp –r /usr/src/a2billing/A2BCustomer_UI/. .
chmod 777 /var/www/html/a2bcustomer_UI/templates_c
Install AGI
The AGI files are how a2b speaks to Asterisk/Trixbox. They consist of the libs_a2billing directory and the a2billing.php file.
cd /var/lib/asterisk/agi-bin
mv a2billing.php a2billing_old.php
cp /usr/src/a2billing/A2Billing_AGI/a2billing.php . (include the dot)
mv libs_a2billing libs_a2billing_old
cp -r /usr/src/a2billing/A2Billing_AGI/libs_a2billing .
chown asterisk:asterisk a2billing.php
chown –R asterisk:asterisk libs_a2billing
Install a2billing.conf file
cd /etc/asterisk
mv a2billing.conf a2billing_old.conf
cp /usr/src/A2Billing_1.3.0/a2billing.conf . (include the dot)
chown asterisk:asterisk a2billing.conf
Edit the a2billing.conf file to select your database.
Change to the database you use. If you use mysql then change from postgres to mysql. Default is postgres.
Edit /etc/asterisk/a2billing.conf with your editor and comment out the database you use.
nano /etc/asterisk/a2billing.conf
In [database] section, change:
dbtype=postgres
;dbtype=mysql
To:
;dbtype=postgres
dbtype=mysql
Log In.
Log into your new A2Billing v.1.3.0 by opening your browser and using the following address.
http://asterisk or box IP/a2billing_UI
login with your username and password
Your done!!!