This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

====== How to Migrate AsterCC System ====== ===== First:Install AsterCC on New Server ===== Refer to: [[en:download_and_install:installation|AsterCC Installation]] <note> Note:The **version** and **modules** of new AsterCC must be exactly same as the old one,so you should install the modules correspondingly after installed the system. </note> ===== Second:Obtain New Authorization ===== On the new server,execute command below,then download the identity via clicking "Download Identity" button on [Realtime]->[System Messages]: <code> /opt/asterisk/scripts/astercc/asterccc --RNI</code> 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. {{:en:faq:download_identity_01.png?750|}} ===== Third:Backup/Recover Database ===== <note tip> For example:We migrate asterCC system from 192.168.1.175 to 192.168.1.146 </note> ==== Database Backup ==== 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. {{:en:faq:backup_plans_1.png?750|}} 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:[[en:module_manual:system:backup_plans|Backup Plans]] {{:en:faq:backup_plans_2.png?750|}} After you finished backup,you can "Edit" or "Delete" the plan which has been added on this page. {{:en:faq:backup_plans_3.png?750|}} === Backup the Database on Background === First,log in server via ssh: <code> ssh root@192.168.1.146 </code> Then enter /var/lib/mysql directory,you can find a database file named "astercc10" <code> cd /var/lib/mysql && ls </code> <code> ls </code> Execute command below,start the backup of database after inputing password: <code> mysqldump -uroot -p astercc10 > astercc20150302.sql </code> 说明: 1.在登录自己本机服务器的数据库时,假如出现 “ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' ”,则需要加上 -h127.0.0.1,即:<code> mysqldump -h127.0.0.1 -uroot -pastercc astercc10 > astercc20150302.sql </code> {{:zh:常见问题及解答:本机服务器dns系统有问题.png?750|}} 2.假如在 cd /var/lib/mysql 时权限不够可以修改权限:<code> sudo chmod 755 mysql </code> 查看具体有哪些权限:<code> ll |grep mysql </code> {{:zh:常见问题及解答:权限不够修改权限.png?750|}} 3.在 mysqldump -h127.0.0.1 -u root -p astercc10 > astercc20150302.sql 数据备份命令中,astercc10:是数据库的名字,astercc20150302.sql:是数据库备份文件 ==== 数据库恢复 ==== 登录175服务器,在 /tmp/backup 下找到刚才备份的文件:BF。命令:<code> ssh dev03@192.168.1.175 </code> 然后再转到backup目录下<code> cd /tmp/backup </code> 然后 ls 一下即可查看到备份好的文件最下面绿框中的即是。 {{:zh:常见问题及解答:备份文件1_1_1.png?900|}} 并将其复制到新的服务器146上的根目录(/)下面,命令:<code> scp -r BF.19.2015-02-28-16-08 root@192.168.1.146:/ </code> 输入146服务器的密码,待右侧全为100%了,也就复制完毕了。 {{:zh:常见问题及解答:备份文件1_1_2.png?545|}}{{:zh:常见问题及解答:备份文件1_1_3.png?240|}} 假如出现warning,如下图。需要执行命令,并删除里面相应信息,输入YES即可。<code> vim ~/.ssh/known_hosts </code> 或者执行下面红框里的内容,如: ssh-keygen -f "/home/dev03/.ssh/known_hosts" -R 192.168.1.146 {{:zh:常见问题及解答:warning01.png?850|}} 登录146服务器:<code> ssh root@192.168.1.146</code> 再找到刚才复制的备份文件并将其解压缩,其中对于.tar.gz类文件解压,命令如下,其中XXXX是压缩文件的名:<code> tar -xzvf XXXX.tar.gz </code> 然后将解压出来的数据库备份文件 导入数据库:<code> mysql -u root -p astercc10 < XXXX.sql</code> 此处XXXX为:astercc10,如下图。最后输入新服务器数据库的密码,默认的是:astercc。其中astercc10是146新服务器上的数据库名字,astercc10.sql是解压出来的数据库备份文件,这样一来,数据库就被迁移导入了。 {{:zh:常见问题及解答:备份文件1_1_5.png?850|}} 到这一步,还没有完全结束,假如老服务器数据库没使用默认的数据库信息,则 需要对新服务器配置文件进行3处手动修改: 1.对astercc.conf->[database]中的相应信息进行修改,比如:dbname、password等等 <code> vim /opt/asterisk/scripts/astercc/astercc.conf </code> 2.对astercc.conf->[statistics]中的相应信息进行修改,比如:dbname、password等等 <code> vim /opt/asterisk/scripts/astercc/astercc.conf </code> 3.对database.php 最后面的 class DATABASE_CONFIG 中 default下的password、database等进行修改 <code> vim /var/www/html/asterCC/app/config/database.php </code> ===== Fourth:复制(覆盖)系统配置文件 ===== 首先,我们在备份时选择了很多系统文件,即在[系统设置]->[备份计划管理]->[添加/编辑 备份计划]->[高级资料]->[备份内容] {{:zh:常见问题及解答:系统文件备份2.png?850|}} 备份好的系统配置文件是可以查看到的(黄框内的文件),我们将其解压(以 "_etc_" 开头的压缩包为例): {{:zh:常见问题及解答:备份的配置文件.png?850|}} 解压命令:<code> tar -xzvf XXXXX.tar.gz </code> 将三条记录都解压,会出现一个叫 etc 的文件夹,解压完后有四个文件夹,将其四个及其目录下的所有文件夹、文件复制到新的服务器“相应”位置, 即: <code> \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 </code> 需要说明的是:\cp是在复制时,不提示覆盖信息用的,-r是有关目录的操作,-p是除复制源文件的内容外,还将把其修改时间和访问权限也复制到新文件中,-f是强行操作 慎重使用。 {{:zh:常见问题及解答:备份文件1_1_6.png?850|}} === 用代码实现即时性系统配置文件的转移(覆盖) === 首先登录登录原来服务器(192.168.1.175),找到[系统设置]->[备份计划管理]->[添加/编辑 备份计划]->[高级资料]->[备份内容]下备份的文件及目录。 <code> 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 </code> ===== Fifth:Reload System ===== 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: <code> cd /opt/asterisk/scripts/astercc/ </code> <code> ./reloadconf.sh </code> {{:zh:常见问题及解答:系统重载1.png?850|}} ===== Solution for FAQ ===== If it displays "Permission denied!" after click reloading tip when finished migration of asterCC,you should try execute command below: <code> chmod 777 /var/www/html/asterCC/cake/console/cake </code> then restart the asterccd service,you should execute command below if it still "Permission denied!": <code> chown -R asterisk.asterisk /var/www/html/asterCC/ chown -R asterisk.asterisk /etc/asterisk </code>

en/faq/how_to_migrate_astercc_system.1449310819.txt.gz · Last modified: 2017/12/12 03:11 (external edit)
Recent changes RSS feed Debian Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki