Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:faq:how_to_migrate_astercc_system [2015/12/06 08:14] – [Fourth:复制(覆盖)系统配置文件] liuxlen:faq:how_to_migrate_astercc_system [2015/12/06 09:48] (current) – [Fourth:Copy(or Overwrite) the Config Files of System] liuxl
Line 91: Line 91:
 {{:zh:常见问题及解答:备份文件1_1_2.png?545|}}{{:zh:常见问题及解答:备份文件1_1_3.png?240|}} {{: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+If it appears warnings as followingyou can delete the corresponding contents under ~/.ssh/known_hosts directory. 
 + 
 +<code> vim ~/.ssh/known_hosts </code> 
 + 
 +Or execute commands below 
 + 
 +<code> ssh-keygen -f "/home/dev03/.ssh/known_hosts" -R 192.168.1.146 </code>
  
 {{:zh:常见问题及解答:warning01.png?850|}} {{:zh:常见问题及解答:warning01.png?850|}}
  
 +Login 192.168.1.146 server:
  
-登录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是解压出来的数据库备份文件,这样一来,数据库就被迁移导入了。+<code> ssh root@192.168.1.146 </code> 
 + 
 +and decompress the .tar.gz archive via executing commands below 
 + 
 +<code> tar -xzvf archive_name.tar.gz </code> 
 + 
 +Import the bakckup file of database 
 + 
 +<code> mysql -u root -p astercc10 < archive_name.sql </code>  
 + 
 +<note tip> **Note**:The default archive name is "astercc10". At lastinput the password of root in mysql. You can see the information of mysql in /etc/astercc.conf. The "astercc10" is the database name on the new serverarchive_name.sql unzip from backup file. </note>
  
 {{:zh:常见问题及解答:备份文件1_1_5.png?850|}} {{:zh:常见问题及解答:备份文件1_1_5.png?850|}}
  
-到这一步还没有完全结束假如老服务器数据库没使用默认的数据库信息,则 需要对新服务器配置文件进行3处手动修改+If the database on the old server use non-default informationwe should revise the database information of new serveras follows
  
-1.astercc.conf->[database]中的相应信息进行修改比如:dbnamepassword等等  <code> vim /opt/asterisk/scripts/astercc/astercc.conf </code> +1.Information in /etc/astercc.conf->[database],eg:dbnamepassword,etc
  
-2.对astercc.conf->[statistics]中的相应信息进行修改,比如:dbname、password等等  <code> vim /opt/asterisk/scripts/astercc/astercc.conf </code> +<code> vim /opt/asterisk/scripts/astercc/astercc.conf </code> 
  
-3.database.php 最后面的 class DATABASE_CONFIG 中 default下的passworddatabase等进行修改  <code> vim /var/www/html/asterCC/app/config/database.php </code> +2.Information in /etc/astercc.conf->[statistics],eg:dbname,password,etc 
 + 
 +<code> vim /opt/asterisk/scripts/astercc/astercc.conf </code>  
 + 
 +3.At the end of /var/www/html/asterCC/app/config/database.php->[class DATABASE_CONFIG]-> [var $default = array],passworddatabase,prefix,etc 
 + 
 +<code> vim /var/www/html/asterCC/app/config/database.php </code> 
  
  
Line 114: Line 137:
 We selected many system file when backup,the list in [System]->[Backup Plans]->[Add Backupplan]->[Advanced]->[Backupfile] We selected many system file when backup,the list in [System]->[Backup Plans]->[Add Backupplan]->[Advanced]->[Backupfile]
  
-{{:zh:常见问题及解答:系统文件备份2.png?850|}}+{{:en:faq:backup_plans_2.png?750|}}
  
-备份好的系统配置文件是可以查看到的(黄框内的文件),我们将其解压(以 "_etc_" 开头的压缩包为例)+You can see the backup file of system config files (marked by yellow rectangle),we can unzip the .tar package execute below commands
  
 {{:zh:常见问题及解答:备份的配置文件.png?850|}} {{:zh:常见问题及解答:备份的配置文件.png?850|}}
  
 Decompress commands: Decompress commands:
-<code> tar -xzvf XXXXX.tar.gz </code> 将三条记录都解压会出现一个叫 etc 的文件夹解压完后有四个文件夹,将其四个及其目录下的所有文件夹、文件复制到新的服务器“相应”位置, 即+ 
 +<code> tar -xzvf XXXXX.tar.gz </code> 
 + 
 +Decompress all archivethen copy(or mv) all files and directories under original location correspondingly, i.e. 
 <code> <code>
 \cp -rpf /BF.19.2015-02-28-16-08/etc/* /etc \cp -rpf /BF.19.2015-02-28-16-08/etc/* /etc
Line 129: Line 156:
 </code> </code>
  
-需要说明的是:\cp是在复制时,不提示覆盖信息用的,-r是有关目录的操作,-p是除复制源文件的内容外,还将把其修改时间和访问权限也复制到新文件中,-f是强行操作 慎重使用。+NoteWhen use "\cp" (not cp) command to copy(or overwrite)there is no any overwrite information. -r:not only copy filesbut also directories. -f:force
  
 {{:zh:常见问题及解答:备份文件1_1_6.png?850|}} {{:zh:常见问题及解答:备份文件1_1_6.png?850|}}
  
  
-=== 用代码实现即时性系统配置文件的转移(覆盖) === +=== Copy(or Overwritethe Config Files of System on Background === 
-首先登录登录原来服务器(192.168.1.175)找到[系统设置]->[备份计划管理]->[添加/编辑 备份计划]->[高级资料]->[备份内容]下备份的文件及目录。+ 
 +First,login the 192.168.1.175 serveryou can see the backup files under [System]->[Backup Plans]->[Add Backupplan]->[Advanced]->[Backupfiledirectory.
  
 <code> <code>
en/faq/how_to_migrate_astercc_system.1449389687.txt.gz · Last modified: (external edit)
Recent changes RSS feed Debian Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki