如何将suiteCRM文件从一个服务器传输到另一个服务器

时间:2022-11-15 19:52:38

I have a site in server xxx, which is slow so I need to transfer it to a server yyy. It is a suiteCRM. So how do I migrate this to the new server , it needs to be a suiteCRM.

我在服务器xxx中有一个站点,这很慢,所以我需要将它转移到服务器yyy。这是一套套房。那么如何将其迁移到新服务器,它需要是一个suiteCRM。

1 个解决方案

#1


Since SuiteCRM is an open-source fork of SugarCRM, the procedure to copy a Suite server is similar to Sugar. The instructions for moving a SugarCRM server are here: http://support.sugarcrm.com/Knowledge_Base/Administration/Platform_Management/Moving_Sugar_to_Another_Server/index.html

由于SuiteCRM是SugarCRM的开源分支,因此复制Suite服务器的过程与Sugar类似。有关移动SugarCRM服务器的说明,请访问:http://support.sugarcrm.com/Knowledge_Base/Administration/Platform_Management/Moving_Sugar_to_Another_Server/index.html

Here's the process I followed to successfully shift a SuiteCRM installation from one Linux/MySQL server to another:

以下是成功将SuiteCRM安装从一个Linux / MySQL服务器转移到另一个Linux / MySQL服务器的过程:

(NB. Do all of the following with super-user privileges, i.e. either login as root, use the sudo command, or prefix all the commands with sudo.)

(注意:以超级用户权限执行以下所有操作,即以root用户身份登录,使用sudo命令,或者使用sudo为所有命令添加前缀。)

  1. Set up the new server with all the pre-requisites needed for SuiteCRM. For Debian, these were the commands:

    设置具有SuiteCRM所需的所有先决条件的新服务器。对于Debian,这些是命令:

    apt-get install apache2
    apt-get install mysql-client
    apt-get install mysql-server
    apt-get install php5
    apt-get install php5-mysql
    

    Make sure you use a strong password for the MySQL root user, and keep a note of it somewhere. It doesn't have to be the same passsword you used on the original SuiteCRM server.

    确保为MySQL root用户使用强密码,并在某处记下它。它不必是您在原始SuiteCRM服务器上使用的相同密码。

    Specify Apache as the web server to reconfigure automatically.

    将Apache指定为Web服务器以自动重新配置。

  2. Set up an Apache Virtual Host to point to the location you want to run SuiteCRM. This is exactly the same as setting up a Virtual Host for any website .. the process is well-documented elsewhere.

    设置Apache虚拟主机以指向要运行SuiteCRM的位置。这与为任何网站设置虚拟主机完全相同。该过程在其他地方有详细记录。

    The webtree for SuiteCRM is the directory you specify using the Apache DocumentRoot directive. I made sure the webtree was the same on the new server as it was on the old, although it may work if you shift it.

    SuiteCRM的webtree是使用Apache DocumentRoot指令指定的目录。我确保新服务器上的webtree与旧服务器上的相同,但是如果你移动它可能会有效。

  3. If your original SuiteCRM installation had a session directory, create this directory on the new server and make sure that the www-data user is able to write to it. E.g.:

    如果原始SuiteCRM安装具有会话目录,请在新服务器上创建此目录,并确保www-data用户能够写入该目录。例如。:

    mkdir /var/www/suitecrm-session-directory
    chown www-data /var/www/suitecrm-session-directory
    

    The session directory must be in the same location as the directory on the old SuiteCRM server, or else you'll need to find and update the SuiteCRM configuration parameter that points to it.

    会话目录必须与旧SuiteCRM服务器上的目录位于同一位置,否则您需要查找并更新指向它的SuiteCRM配置参数。

  4. Copy across all the files in the webtree on the old SuiteCRM server to the new. I used rsync for this. In the following example, the webtree was /var/www/suitecrm on both the old and new servers.

    将旧SuiteCRM服务器上的webtree中的所有文件复制到新文件。我为此使用了rsync。在以下示例中,webtree在旧服务器和新服务器上都是/ var / www / suitecrm。

    First make sure rsync is installed on both the old and new servers using:

    首先确保使用以下命令在旧服务器和新服务器上安装rsync:

    apt-get install rsync
    

    Then log into the new webserver and run the following (replace "root" with the user you log in as on the old server, and "oldserver.com" with the URL of the old server):

    然后登录到新的Web服务器并运行以下命令(将“root”替换为您在旧服务器上登录的用户,将“oldserver.com”替换为旧服务器的URL):

    cd /var/www/suitecrm
    rsync -avg -e ssh root@oldserver.com:/var/www/suitecrm .
    

    You'll be prompted for the user password unless you've got certificate-based SSH authentication set up.

    除非您已设置基于证书的SSH身份验证,否则系统将提示您输入用户密码。

  5. Log in to the old SuiteCRM server and take a copy of the database. You'll need to know the MySQL database root user password (replace "suitecrm" with the actual name of the SuiteCRM database on the old server):

    登录旧的SuiteCRM服务器并获取数据库的副本。您需要知道MySQL数据库root用户密码(将“suitecrm”替换为旧服务器上SuiteCRM数据库的实际名称):

    mysqldump --user=root --password=theactualpassword suitecrm >suitecrmdump.sql
    
  6. Copy the database dump that you've just created across to the new server. I used scp for this. Log in to the new server and run the following (replace "root" with the user you log in as on the old server, and "oldserver.com" with the URL of the old server):

    将刚刚创建的数据库转储复制到新服务器。我用scp来做这件事。登录到新服务器并运行以下命令(将“root”替换为您在旧服务器上登录的用户,将“oldserver.com”替换为旧服务器的URL):

    scp root@oldserver.com:~/suitecrmdump.sql .
    
  7. Create the database on the new server and import the data from the database dump. NB. You'll need to keep the database name the same - if not, then you'll need to find and update the SuiteCRM configuration parameter that points to this. Carry out the following on the new server:

    在新服务器上创建数据库并从数据库转储中导入数据。 NB。您需要保持数据库名称相同 - 如果没有,那么您需要查找并更新指向此的SuiteCRM配置参数。在新服务器上执行以下操作:

    mysql --user=root --password=theactualpassword
    

    From the mysql prompt:

    从mysql提示符:

    create database suitecrm;
    exit
    

    Then:

    mysql --user=root --password=theactualpassword suitecrm <suitecrmdump.sql
    
  8. Create the MySQL database users that SuiteCRM will use to access the database.

    创建SuiteCRM将用于访问数据库的MySQL数据库用户。

    First log in to the old database server and run:

    首先登录旧数据库服务器并运行:

    mysql --user=root --password=theactualpassword
    

    From the mysql prompt:

    从mysql提示符:

    SELECT Host,User from mysql.user;
    

    This will display a list of database users. Two of them will be SuiteCRM users - one on localhost, the other on the SuiteCRM installation's public URL.

    这将显示数据库用户列表。其中两个将是SuiteCRM用户 - 一个在localhost上,另一个在SuiteCRM安装的公共URL上。

    Type the following to exit MySQL:

    键入以下内容以退出MySQL:

    exit
    

    Log in to the new database server and run:

    登录到新的数据库服务器并运行:

    mysql --user=root --password=theactualpassword
    

    From the mysql prompt (replace "suitecrmuser" and "suitehost.com" with the actual users and hosts you noted down from the old server. Also use the same SuiteCRM database user password that was used in the old server, or else you'll need to find and update the relevant configuration parameter in SuiteCRM. This may be different from the database root user's password):

    从mysql提示符(将“suitecrmuser”和“suitehost.com”替换为您从旧服务器记下的实际用户和主机。还使用旧服务器中使用的相同SuiteCRM数据库用户密码,否则您将使用需要查找和更新SuiteCRM中的相关配置参数。这可能与数据库root用户的密码不同):

    CREATE USER 'suitecrmuser'@'localhost' IDENTIFIED BY 'password';
    CREATE USER 'suitecrmuser'@'suitehost.com' IDENTIFIED BY 'password';
    
  9. Make a copy of the access rights for the SuiteCRM users:

    复制SuiteCRM用户的访问权限:

    First log in to the old database server and run:

    首先登录旧数据库服务器并运行:

    mysql --user=root --password=theactualpassword
    

    From the mysql prompt:

    从mysql提示符:

    SHOW GRANTS FOR 'suitecrmuser'@'localhost';
    SHOW GRANTS FOR 'suitecrmuser'@'suitehost.crm';
    

    Copy the grants that appear to a text editor. Remove the pipe symbols from the start and end of the lines. The grants for each user consist of two lines of SQL code beginning with GRANT USAGE ON.

    将显示的授权复制到文本编辑器。从行的开头和结尾删除管道符号。每个用户的授权包含两行以GRANT USAGE ON开头的SQL代码。

    Type the following to exit MySQL:

    键入以下内容以退出MySQL:

    exit
    
  10. Apply the access rights to the users on the new server:

    将访问权限应用于新服务器上的用户:

    Log in to the new database server and run:

    登录到新的数据库服务器并运行:

    mysql --user=root --password=theactualpassword
    

    At the mysql prompt, paste in the lines of SQL beginning with GRANT USAGE ON, for each of the two database users. There should be four lines all up. Add a semi-colon to the end of each line. Press Enter on each line to run the SQL code and apply the rights.

    在mysql提示符下,为两个数据库用户中的每一个粘贴以GRANT USAGE ON开头的SQL行。全部应该有四条线。在每行的末尾添加一个分号。按每行上的Enter键以运行SQL代码并应用权限。

    Type the following to exit MySQL:

    键入以下内容以退出MySQL:

    exit
    
  11. Copy over the SuiteCRM crontab entry from the old server to the new.

    将SuiteCRM crontab条目从旧服务器复制到新服务器。

    First log in to the old server and run:

    首先登录旧服务器并运行:

    crontab -l
    

    This will list the crontab entries on the server. There should be an entry for SuiteCRM's regular cron task, which runs every minute. Copy this line to a text editor.

    这将列出服务器上的crontab条目。 SuiteCRM的常规cron任务应该有一个条目,每分钟运行一次。将此行复制到文本编辑器。

    Then log in to the new server and run:

    然后登录到新服务器并运行:

    crontab -e
    

    This will open the cron table on the new server in edit mode. Paste in the SuiteCRM crontab entry. Exit and save - to do this on Debian Linux, press Ctrl-X and answer Yes to the prompt that appears.

    这将在编辑模式下打开新服务器上的cron表。粘贴在SuiteCRM crontab条目中。退出并保存 - 要在Debian Linux上执行此操作,请按Ctrl-X并对出现的提示回答“是”。

  12. Test everything thoroughly to make sure it works.

    彻底测试所有内容以确保其正常工作。

    Using a test workstation, edit the c:\windows\system32\drivers\etc\hosts file to set your SuiteCRM server's URL to point to the new server. Make sure it's working correctly before cutting over the DNS. Remove the hosts file entries after the testing is completed.

    使用测试工作站,编辑c:\ windows \ system32 \ drivers \ etc \ hosts文件,将SuiteCRM服务器的URL设置为指向新服务器。在切换DNS之前确保它正常工作。测试完成后删除hosts文件条目。

  13. Cut over the DNS, using your DNS nameserver service. Edit the zonefile to point the URL of your Suite server to the IP address of the new server.

    使用DNS名称服务器服务切换DNS。编辑zonefile以将Suite服务器的URL指向新服务器的IP地址。

#1


Since SuiteCRM is an open-source fork of SugarCRM, the procedure to copy a Suite server is similar to Sugar. The instructions for moving a SugarCRM server are here: http://support.sugarcrm.com/Knowledge_Base/Administration/Platform_Management/Moving_Sugar_to_Another_Server/index.html

由于SuiteCRM是SugarCRM的开源分支,因此复制Suite服务器的过程与Sugar类似。有关移动SugarCRM服务器的说明,请访问:http://support.sugarcrm.com/Knowledge_Base/Administration/Platform_Management/Moving_Sugar_to_Another_Server/index.html

Here's the process I followed to successfully shift a SuiteCRM installation from one Linux/MySQL server to another:

以下是成功将SuiteCRM安装从一个Linux / MySQL服务器转移到另一个Linux / MySQL服务器的过程:

(NB. Do all of the following with super-user privileges, i.e. either login as root, use the sudo command, or prefix all the commands with sudo.)

(注意:以超级用户权限执行以下所有操作,即以root用户身份登录,使用sudo命令,或者使用sudo为所有命令添加前缀。)

  1. Set up the new server with all the pre-requisites needed for SuiteCRM. For Debian, these were the commands:

    设置具有SuiteCRM所需的所有先决条件的新服务器。对于Debian,这些是命令:

    apt-get install apache2
    apt-get install mysql-client
    apt-get install mysql-server
    apt-get install php5
    apt-get install php5-mysql
    

    Make sure you use a strong password for the MySQL root user, and keep a note of it somewhere. It doesn't have to be the same passsword you used on the original SuiteCRM server.

    确保为MySQL root用户使用强密码,并在某处记下它。它不必是您在原始SuiteCRM服务器上使用的相同密码。

    Specify Apache as the web server to reconfigure automatically.

    将Apache指定为Web服务器以自动重新配置。

  2. Set up an Apache Virtual Host to point to the location you want to run SuiteCRM. This is exactly the same as setting up a Virtual Host for any website .. the process is well-documented elsewhere.

    设置Apache虚拟主机以指向要运行SuiteCRM的位置。这与为任何网站设置虚拟主机完全相同。该过程在其他地方有详细记录。

    The webtree for SuiteCRM is the directory you specify using the Apache DocumentRoot directive. I made sure the webtree was the same on the new server as it was on the old, although it may work if you shift it.

    SuiteCRM的webtree是使用Apache DocumentRoot指令指定的目录。我确保新服务器上的webtree与旧服务器上的相同,但是如果你移动它可能会有效。

  3. If your original SuiteCRM installation had a session directory, create this directory on the new server and make sure that the www-data user is able to write to it. E.g.:

    如果原始SuiteCRM安装具有会话目录,请在新服务器上创建此目录,并确保www-data用户能够写入该目录。例如。:

    mkdir /var/www/suitecrm-session-directory
    chown www-data /var/www/suitecrm-session-directory
    

    The session directory must be in the same location as the directory on the old SuiteCRM server, or else you'll need to find and update the SuiteCRM configuration parameter that points to it.

    会话目录必须与旧SuiteCRM服务器上的目录位于同一位置,否则您需要查找并更新指向它的SuiteCRM配置参数。

  4. Copy across all the files in the webtree on the old SuiteCRM server to the new. I used rsync for this. In the following example, the webtree was /var/www/suitecrm on both the old and new servers.

    将旧SuiteCRM服务器上的webtree中的所有文件复制到新文件。我为此使用了rsync。在以下示例中,webtree在旧服务器和新服务器上都是/ var / www / suitecrm。

    First make sure rsync is installed on both the old and new servers using:

    首先确保使用以下命令在旧服务器和新服务器上安装rsync:

    apt-get install rsync
    

    Then log into the new webserver and run the following (replace "root" with the user you log in as on the old server, and "oldserver.com" with the URL of the old server):

    然后登录到新的Web服务器并运行以下命令(将“root”替换为您在旧服务器上登录的用户,将“oldserver.com”替换为旧服务器的URL):

    cd /var/www/suitecrm
    rsync -avg -e ssh root@oldserver.com:/var/www/suitecrm .
    

    You'll be prompted for the user password unless you've got certificate-based SSH authentication set up.

    除非您已设置基于证书的SSH身份验证,否则系统将提示您输入用户密码。

  5. Log in to the old SuiteCRM server and take a copy of the database. You'll need to know the MySQL database root user password (replace "suitecrm" with the actual name of the SuiteCRM database on the old server):

    登录旧的SuiteCRM服务器并获取数据库的副本。您需要知道MySQL数据库root用户密码(将“suitecrm”替换为旧服务器上SuiteCRM数据库的实际名称):

    mysqldump --user=root --password=theactualpassword suitecrm >suitecrmdump.sql
    
  6. Copy the database dump that you've just created across to the new server. I used scp for this. Log in to the new server and run the following (replace "root" with the user you log in as on the old server, and "oldserver.com" with the URL of the old server):

    将刚刚创建的数据库转储复制到新服务器。我用scp来做这件事。登录到新服务器并运行以下命令(将“root”替换为您在旧服务器上登录的用户,将“oldserver.com”替换为旧服务器的URL):

    scp root@oldserver.com:~/suitecrmdump.sql .
    
  7. Create the database on the new server and import the data from the database dump. NB. You'll need to keep the database name the same - if not, then you'll need to find and update the SuiteCRM configuration parameter that points to this. Carry out the following on the new server:

    在新服务器上创建数据库并从数据库转储中导入数据。 NB。您需要保持数据库名称相同 - 如果没有,那么您需要查找并更新指向此的SuiteCRM配置参数。在新服务器上执行以下操作:

    mysql --user=root --password=theactualpassword
    

    From the mysql prompt:

    从mysql提示符:

    create database suitecrm;
    exit
    

    Then:

    mysql --user=root --password=theactualpassword suitecrm <suitecrmdump.sql
    
  8. Create the MySQL database users that SuiteCRM will use to access the database.

    创建SuiteCRM将用于访问数据库的MySQL数据库用户。

    First log in to the old database server and run:

    首先登录旧数据库服务器并运行:

    mysql --user=root --password=theactualpassword
    

    From the mysql prompt:

    从mysql提示符:

    SELECT Host,User from mysql.user;
    

    This will display a list of database users. Two of them will be SuiteCRM users - one on localhost, the other on the SuiteCRM installation's public URL.

    这将显示数据库用户列表。其中两个将是SuiteCRM用户 - 一个在localhost上,另一个在SuiteCRM安装的公共URL上。

    Type the following to exit MySQL:

    键入以下内容以退出MySQL:

    exit
    

    Log in to the new database server and run:

    登录到新的数据库服务器并运行:

    mysql --user=root --password=theactualpassword
    

    From the mysql prompt (replace "suitecrmuser" and "suitehost.com" with the actual users and hosts you noted down from the old server. Also use the same SuiteCRM database user password that was used in the old server, or else you'll need to find and update the relevant configuration parameter in SuiteCRM. This may be different from the database root user's password):

    从mysql提示符(将“suitecrmuser”和“suitehost.com”替换为您从旧服务器记下的实际用户和主机。还使用旧服务器中使用的相同SuiteCRM数据库用户密码,否则您将使用需要查找和更新SuiteCRM中的相关配置参数。这可能与数据库root用户的密码不同):

    CREATE USER 'suitecrmuser'@'localhost' IDENTIFIED BY 'password';
    CREATE USER 'suitecrmuser'@'suitehost.com' IDENTIFIED BY 'password';
    
  9. Make a copy of the access rights for the SuiteCRM users:

    复制SuiteCRM用户的访问权限:

    First log in to the old database server and run:

    首先登录旧数据库服务器并运行:

    mysql --user=root --password=theactualpassword
    

    From the mysql prompt:

    从mysql提示符:

    SHOW GRANTS FOR 'suitecrmuser'@'localhost';
    SHOW GRANTS FOR 'suitecrmuser'@'suitehost.crm';
    

    Copy the grants that appear to a text editor. Remove the pipe symbols from the start and end of the lines. The grants for each user consist of two lines of SQL code beginning with GRANT USAGE ON.

    将显示的授权复制到文本编辑器。从行的开头和结尾删除管道符号。每个用户的授权包含两行以GRANT USAGE ON开头的SQL代码。

    Type the following to exit MySQL:

    键入以下内容以退出MySQL:

    exit
    
  10. Apply the access rights to the users on the new server:

    将访问权限应用于新服务器上的用户:

    Log in to the new database server and run:

    登录到新的数据库服务器并运行:

    mysql --user=root --password=theactualpassword
    

    At the mysql prompt, paste in the lines of SQL beginning with GRANT USAGE ON, for each of the two database users. There should be four lines all up. Add a semi-colon to the end of each line. Press Enter on each line to run the SQL code and apply the rights.

    在mysql提示符下,为两个数据库用户中的每一个粘贴以GRANT USAGE ON开头的SQL行。全部应该有四条线。在每行的末尾添加一个分号。按每行上的Enter键以运行SQL代码并应用权限。

    Type the following to exit MySQL:

    键入以下内容以退出MySQL:

    exit
    
  11. Copy over the SuiteCRM crontab entry from the old server to the new.

    将SuiteCRM crontab条目从旧服务器复制到新服务器。

    First log in to the old server and run:

    首先登录旧服务器并运行:

    crontab -l
    

    This will list the crontab entries on the server. There should be an entry for SuiteCRM's regular cron task, which runs every minute. Copy this line to a text editor.

    这将列出服务器上的crontab条目。 SuiteCRM的常规cron任务应该有一个条目,每分钟运行一次。将此行复制到文本编辑器。

    Then log in to the new server and run:

    然后登录到新服务器并运行:

    crontab -e
    

    This will open the cron table on the new server in edit mode. Paste in the SuiteCRM crontab entry. Exit and save - to do this on Debian Linux, press Ctrl-X and answer Yes to the prompt that appears.

    这将在编辑模式下打开新服务器上的cron表。粘贴在SuiteCRM crontab条目中。退出并保存 - 要在Debian Linux上执行此操作,请按Ctrl-X并对出现的提示回答“是”。

  12. Test everything thoroughly to make sure it works.

    彻底测试所有内容以确保其正常工作。

    Using a test workstation, edit the c:\windows\system32\drivers\etc\hosts file to set your SuiteCRM server's URL to point to the new server. Make sure it's working correctly before cutting over the DNS. Remove the hosts file entries after the testing is completed.

    使用测试工作站,编辑c:\ windows \ system32 \ drivers \ etc \ hosts文件,将SuiteCRM服务器的URL设置为指向新服务器。在切换DNS之前确保它正常工作。测试完成后删除hosts文件条目。

  13. Cut over the DNS, using your DNS nameserver service. Edit the zonefile to point the URL of your Suite server to the IP address of the new server.

    使用DNS名称服务器服务切换DNS。编辑zonefile以将Suite服务器的URL指向新服务器的IP地址。