This is an old revision of the document!
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:
假如出现warning,如下图。需要执行命令,并删除里面相应信息,输入YES即可。
vim ~/.ssh/known_hosts或者执行下面红框里的内容,如: ssh-keygen -f “/home/dev03/.ssh/known_hosts” -R 192.168.1.146
登录146服务器:
ssh root@192.168.1.146再找到刚才复制的备份文件并将其解压缩,其中对于.tar.gz类文件解压,命令如下,其中XXXX是压缩文件的名:
tar -xzvf XXXX.tar.gz然后将解压出来的数据库备份文件 导入数据库:
mysql -u root -p astercc10 < XXXX.sql此处XXXX为:astercc10,如下图。最后输入新服务器数据库的密码,默认的是:astercc。其中astercc10是146新服务器上的数据库名字,astercc10.sql是解压出来的数据库备份文件,这样一来,数据库就被迁移导入了。
到这一步,还没有完全结束,假如老服务器数据库没使用默认的数据库信息,则 需要对新服务器配置文件进行3处手动修改:
1.对astercc.conf→[database]中的相应信息进行修改,比如:dbname、password等等
vim /opt/asterisk/scripts/astercc/astercc.conf
2.对astercc.conf→[statistics]中的相应信息进行修改,比如:dbname、password等等
vim /opt/asterisk/scripts/astercc/astercc.conf
3.对database.php 最后面的 class DATABASE_CONFIG 中 default下的password、database等进行修改
vim /var/www/html/asterCC/app/config/database.php
我们在备份时选择了很多系统文件,即在[系统设置]→[备份计划管理]→[添加/编辑 备份计划]→[高级资料]→[备份内容]
备份好的系统配置文件是可以查看到的(黄框内的文件),我们将其解压(以 “_etc_” 开头的压缩包为例):
解压命令:
tar -xzvf XXXXX.tar.gz将三条记录都解压,会出现一个叫 etc 的文件夹,解压完后有四个文件夹,将其四个及其目录下的所有文件夹、文件复制到新的服务器“相应”位置, 即:
\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
需要说明的是:\cp是在复制时,不提示覆盖信息用的,-r是有关目录的操作,-p是除复制源文件的内容外,还将把其修改时间和访问权限也复制到新文件中,-f是强行操作 慎重使用。
首先登录登录原来服务器(192.168.1.175),找到[系统设置]→[备份计划管理]→[添加/编辑 备份计划]→[高级资料]→[备份内容]下备份的文件及目录。
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