Refer to: AsterCC Installation
On the new server,execute command below,then download the identity via clicking “Download Identity” button on [Realtime]→[System Messages]:
/opt/asterisk/scripts/astercc/asterccc --RNI
Then,download the identity of old server without executing command,and send both two identities to Email:support@astercc.org or support@sonicwell.com,explain the situation of your demands.Several minutes later,technical support specialist will reply to you.
Open the menu on the left,click [System]→[Backup Plans]→[Add Backupplan],you will enter plan adding page,as follows:
Planname:to identify the backup plan.
Kept days:It used to set the retaining duration of the backup file,you can set it according to disk's usage.
And in [Advanced],double-click the items which need to backup,there are 10 items in total. Set the “DB Details” refer to following format,or refer to:Backup Plans
After you finished backup,you can “Edit” or “Delete” the plan which has been added on this page.
First,log in server via ssh:
ssh root@192.168.1.146
Then enter /var/lib/mysql directory,you can find a database file named “astercc10”
cd /var/lib/mysql && ls
Execute command below,start the backup of database after inputing password:
mysqldump -uroot -p astercc10 > astercc20150302.sql
Exception:
1.You should add “-h127.0.0.1” if “ ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' ” when you login msyql,eg:
mysqldump -h127.0.0.1 -uroot -pastercc astercc10 > astercc20150302.sql
2.If there is “bash:cd:/var/lib/mysql/:Permission denied” when you execute “cd /var/lib/mysql”,you can check and change privilege of mysql:
ll |grep mysql
sudo chmod 755 mysql
Log in 192.168.1.175,you can find the backup file named “BF” under /tmp/backup directory:
ssh dev03@192.168.1.175
cd /tmp/backup && ls
and copy it to / directory on 192.168.1.146 server,execute command below on 192.168.1.175:
scp -r BF.19.2015-02-28-16-08 root@192.168.1.146:/
It it finished until progress rate turn to 100% on the right,as is shown below:
If it appears warnings as following,you can delete the corresponding contents under ~/.ssh/known_hosts directory.
vim ~/.ssh/known_hosts
Or execute commands below:
ssh-keygen -f "/home/dev03/.ssh/known_hosts" -R 192.168.1.146
Login 192.168.1.146 server:
ssh root@192.168.1.146
and decompress the .tar.gz archive via executing commands below:
tar -xzvf archive_name.tar.gz
Import the bakckup file of database:
mysql -u root -p astercc10 < archive_name.sql
If the database on the old server use non-default information,we should revise the database information of new server,as follows:
1.Information in /etc/astercc.conf→[database],eg:dbname,password,etc
vim /opt/asterisk/scripts/astercc/astercc.conf
2.Information in /etc/astercc.conf→[statistics],eg:dbname,password,etc
vim /opt/asterisk/scripts/astercc/astercc.conf
3.At the end of /var/www/html/asterCC/app/config/database.php→[class DATABASE_CONFIG]→ [var $default = array],password,database,prefix,etc
vim /var/www/html/asterCC/app/config/database.php
We selected many system file when backup,the list in [System]→[Backup Plans]→[Add Backupplan]→[Advanced]→[Backupfile]
You can see the backup file of system config files (marked by yellow rectangle),we can unzip the .tar package execute below commands:
Decompress commands:
tar -xzvf XXXXX.tar.gz
Decompress all archive,then copy(or mv) all files and directories under original location correspondingly, i.e.:
\cp -rpf /BF.19.2015-02-28-16-08/etc/* /etc \cp -rpf /BF.19.2015-02-28-16-08/var/* /var \cp -rpf /BF.19.2015-02-28-16-08/opt/* /opt \cp -rpf /BF.19.2015-02-28-16-08/usr/* /usr
Note:When use “\cp” (not cp) command to copy(or overwrite),there is no any overwrite information. -r:not only copy files,but also directories. -f:force
First,login the 192.168.1.175 server,you can see the backup files under [System]→[Backup Plans]→[Add Backupplan]→[Advanced]→[Backupfile] directory.
scp -rp /var/lib/asterisk/* root@192.168.1.146:/var/lib/asterisk ,(then input the password of user) scp -rp /var/spool/asterisk/voicemail/* root@192.168.1.146:/var/spool/asterisk/voicemail scp -rp /var/spool/asterisk/monitor/* root@192.168.1.146:/var/spool/asterisk/monitor scp -rp /usr/lib/asterisk/* root@192.168.1.146:/usr/lib/asterisk scp -rp /etc/asterisk/* root@192.168.1.146:/etc/asterisk scp -rp /etc/dahdi/* root@192.168.1.146:/etc/dahdi scp -rp /opt/asterisk/scripts/astercc/* root@192.168.1.146:/opt/asterisk/scripts/astercc scp -rp /var/www/html/asterCC/* root@192.168.1.146:/var/www/html/asterCC scp -rp /var/lib/sounds/* root@192.168.1.146:/var/lib/sounds
After importing database backup and replacing the corresponding files,we need reload system via execute scripts named “reloadconf.sh” under /opt/asterisk/scripts/astercc/ directory:
cd /opt/asterisk/scripts/astercc/
./reloadconf.sh
If it displays “Permission denied!” after click reloading tip when finished migration of asterCC,you should try execute command below:
chmod 777 /var/www/html/asterCC/cake/console/cake
then restart the asterccd service,you should execute command below if it still “Permission denied!”:
chown -R asterisk.asterisk /var/www/html/asterCC/ chown -R asterisk.asterisk /etc/asterisk