The site transfer procedure can be performed using special scripts created by the Bitrix company, which simplifies and facilitates the process.

Perform the following actions to transfer your site to the remote server.

  1. Ensure the remote hosting service conforms the minimum system requirements;
  2. Ensure the system core is not encoded. If the kernel is encoded, the remote server must have Zend Optimizer version 2.6.x or higher installed and operational.
  3. Ensure that the user on which the Apache (PHP) runs is given a permission of 0777 (full access) to all files in the site root.
  4. Copy all scripts from the local machine to the remote server via the FTP.

    You can boost this process by performing the following actions.

    • Download the script mkinst.php from http://www.bitrixsoft.com/examples/mkinst.php to the root folder of your local site (i.e. on the local machine).
    • Move all files whose size exceed the hosting provider's PHP limit (usually 8 Mb) from the local site folder to some other storage (folder). This is necessary because some files may exceed the hosting provider's PHP limit (e.g. database dump file). The standard distribution package of Bitrix Site Manager does not contain such files.
    • Open the following page in your browser: http://<local_site>/mkinst.php, replacing <local_site> with the local site address (e.g. localhost).

      After that, the root folder of your local site will contain an archive file install.gz. The browser will display the archive information (total count of files and the size).

    • Copy the file install.gz to the root folder of your site on the remote server via the FTP.
    • Download script file install.php from http://www.bitrixsoft.com/examples/install.php.
    • Copy the file install.php to the root folder of your site on the remote server via the FTP.
    • Open the page http://<your_remote_site>/install.php in your browser, replacing <your_remote_site> with the address of your site. If the PHP has permissions required to create files (0777), the site will be unpacked.
    • Remember to delete scripts mkinst.php and install.php from the remote server. Besides, remember to delete or move (one level up) the file install.gz.
  1. The next step is to copy the database to the remote server.
    • Create the database dump (copy in the form of SQL instructions). One of the ways to create a dump is running the standard MySQL tool:
      mysqldump.exe --add-drop-table -p <local_database_name> > bitrix.dmp

      You can obtain more information on the tool parameters by running

      mysqldump.exe --?
    • After the file bitrix.dmp is created, open it for editing in any text editor. Delete the following line from the file:

      use <local_database_name>,


      This command is usually located at the beginning of the file. Copy the file to the remote server via the FTP.
    • Next, establish a connection to the remote MySQL database. You can do this by using either the SSH (SSH2) protocol, or any other protocol allowed by your hosting service provider for remote access. You can also use the standard tool mysql.exe by simply running it on your local machine. You can take the advantage of using the mysql.exe tool if only the hosting provider allows it.
      • Connecting via the SSH:
        mysql -u <user> -h <server_IP> -P 3306 -p <remote_DB_name>
        
        Enter password: <password> 
                
      • Connecting via the mysql.exe tool:
        mysql.exe -u <user> -h <server_IP> -P 3306 -p <remote_DB_name>            
        
        Enter password: <password>
    • After you have established connection to the database, you have to select the active database to which you will copy the dump. You can do this by issuing a command:

      use <remote_DB_name>

    • The next command uploads the dump to the remote server:

      \. <full_or_short_file_name>

  2. After you have successfully transferred the database and scripts to the remote server, you have to open the remote file /bitrix/php_inteface/dbconn.php in any text editor and change the connection parameters to the remote database.
  3. Delete or move the database dump remote file bitrix.dmp.

Creating and unpacking tar.gz archives

Creating an archive

Method 1

tar -zvcf <dirname>.tar.gz <dirname>/

Method 2

tar -c dirname|gzip -c - > dirname.tar.gz

Unpacking an archive

Method 1

tar -zxvf file_name.tar.gz

Method 2

gunzip file_name.tar.gz
tar xf file_name


 Using the back-up and restoration built-in tools | Course description | Uninstalling Bitrix Site Manager