Move / Change Password RasPBX Database

Overview

Migrating Host

First export and import the database data into the new database. It goes without saying that the RasPBX should be stopped or any changes between the export and import will not be captured and lost. The root password the local database is raspberry

To stop FreePBX:
sudo amportal stop

There are 2 databases to export called asterisk and asteriskcdrdb. The former contains settings and the latter contains the call records.

There is also a asteriskuser account to copy over. The default password is rasp_amp which should be changed but if you’re moving the database, it’s best to leave it as default, get it working and then going back to change it.

Change Host / Password

The following places needs to be changed. Ideally the password would be different but the host address should be changed to the new server address.

Edit /etc/freepbx.conf and change:
password:
$amp_conf['AMPDBPASS'] = 'rasp_amp';
host:
$amp_conf['AMPDBHOST'] = 'localhost';

Edit /etc/amportal.conf:
password:
AMPDBPASS=rasp_amp
host:
AMPDBHOST=localhost

Edit /etc/asterisk/cdr_mysql.conf:
password:
password = rasp_amp

host:
hostname = localhost

Start FreePBX
sudo amportal start

First check the logs in /var/log/asterisk/full for any signs it cannot connect to the database. Ensure there has been enough times for the extensions / handsets to reconnect to the FreePBX.

Next make a test call (even a call where it was hungup without being picked up) and see if it was looked in the CDR report.

Post Migration

Disable MySQL from starting up:
update-rc.d mysql disable
This will leave the database installed but not running.

Summary

Changing and moving the database is fairly quick and easy but finding where all the configuration lies is the hard part.

How to change the default FreePBX MYSQL password

No reports in FreePBX but there are recors in cdr db-table

RasPBX MySQL Root Password

About Danny

I.T software professional always studying and applying the knowledge gained and one way of doing this is to blog. Danny also has participates in a part time project called Energy@Home [http://code.google.com/p/energyathome/] for monitoring energy usage on a premise. Dedicated to I.T since studying pure Information Technology since the age of 16, Danny Tsang working in the field that he has aimed for since leaving school. View all posts by Danny → This entry was posted in PBX and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *.

All comments must go through an approval and anti-spam process before appearing on the website. Please be patience and do not re-submit your comment if it does not appear.

This site uses Akismet to reduce spam. Learn how your comment data is processed.