suitecrm 如何backup and restore ,从一个server 转移到另一个 server . 并保证customer package , customer module 不丢
1 :suite backup 分为数据库和网站两部分, 在网站目录下config.php, 可以看到数据库名字等信息 。
在 /home 目录下 ,新建 liuyang 目录 — mkdir liuyang
给予写权限 — sudo chmod -R a+rw /home/liuyang
2 :登陆 suitecrm 网站 ,admin—-backup 到刚才的目录
3 :备份数据库 先登陆 : mysql -u root -p , 输入密码 。—– 不需要这步 (不是必须的,这里有重复)
4 :在系统命令行,而不是my sql 命令行下面 ,执行 mysqldump -u 数据库用户名不带引号 -p‘数据库密码‘ suitecrm > /home/liuyang/crmbackup.sql
其中 suitecrm 是数据库名字
5: 把第二步和第三步备份的数据库文件和网站文件用 winscp 传到新网站,因为都是 linux , 所以用winscp 传新网站部分
先暂停 apache: sudo /etc/init.d/apache2 stop
6 : 恢复数据库 ,还是在系统命令行下 ,执行: mysql -u 数据库用户名不带引号 -p‘数据库密码‘ suitecrm < /home/liuyang/crmbackup.sql
7 : 覆盖 custom 目录 mv /home/liuyang/custom/ /var/www/html/suite/
第一个参数是 src path ,第二个是 dest path 。 mv 相当于 cut paste 红字部分是错误的, 应该覆盖整个网站目录。
步骤是 : 先删除当前的网站文件夹 : 到 /var/www/html/ 目录下 ,
执行 sudo rm -rf suite
再新建 suite 目录 sudo mkdir suite
把备份文件解压后copy到新目录: sudo mv /home/temp/ /var/www/html/suite/
如果新旧数据库密码不一样,到 /var/www/html/suite/ 目录下 config.php 改
8 : 启动 apache: sudo /etc/init.d/apache2 start
OVER
用到的其他 ubantu 命令: 删除某目录所有文件和目录本身 rm -rf foldername 减一层菜单
With the folder called ‘myfolder‘ and up one level in the file hierarchy (the point you want it to put) the command would be:
mv myfolder/* .
So for example if the data was in /home/myuser/myfolder then from /home/myuser/ run the command.
重启 apche: sudo /etc/init.d/apache2 restart
列出所有正在运行的 site ——— apache2ctl -S
给某目录及下面所有子目录的文件全权限 sudo chmod -R 777 /var/www