Transferring an online store website from the Bitrix engine Site Management to Bitrix 24

Briefly about the essence of the article

The engine, also known as the framework, 1C-Bitrix is ​​quite popular in the CIS countries.
It captivates with its versatility, its own marketplace with many expansion modules, both paid and free. There are many online stores on this engine from different developers, as well as CRM system Bitrix 24.
Precisely due to the fact that a CRM system and an online store can exist separately on the same engine, one common mistake among many users is very common. The roots of which come from the age-old problem of interaction between different IT specialists. The essence of the error is that clients hire front-end specialists who know how to work with the 1C-Bitrix engine to install and launch an online store website, and they recommend the boxed editions of “1C-Bitrix Site Management” for purchase. While the client already has a corporate portal CRM Bitrix 24. Yes, standard exchange module between B24 and 1S-BUS available, but it only works well with a standard preset set of objects and settings. In practice, there is not a single B24 CRM portal where custom fields, universal lists, redone transactions, and much more would not be added.

As a result, we get an extremely complex structure of two-way synchronization
1С-Предприятие <-> CRM Битрикс 24 <-> Интернет магазин 1С-БУС
debugging which becomes unrealistic, especially in the face of constant changes in objects and their behavior.

One of the most popular sites (modules, templates) of an online store for the 1C-Bitrix engine is ASPRO (at least among my clients). It is with his example that I will show how you can transfer a site online store from 1C-BUS engine to CRM Bitrix 24.

Main migration steps

  1. Transfer of ASPRO license.

  2. Updating both portals to the latest versions.

  3. Installing ASPRO on the Bitrix 24 CRM host.

  4. Transferring general ASPRO settings.

  5. Transfer of information blocks.

  6. Customizing the menu and home page.

  7. Transferring changes made to templates.

Transfer of ASPRO license

Submitting an application to transfer a website from one host to another (from the key of one portal to the key of another) is completed by contacting ASPRO support. ATTENTION Transfer is possible only once! If you change your mind there will be no way to go back ((
After transferring the license, the ASPRO website on the old host will continue to work, but will not be updated! Therefore, it is important to make the transfer as soon as the license is transferred, otherwise a situation may arise that the B24 portal engine was updated, but ASPRO was not, with all the consequences.

It is important to transfer immediatelyas soon as the license is transferred, otherwise a situation may arise that the B24 portal engine was updated, but ASPRO was not, with all the consequences.

Updating both portals to the latest versions

Ideally, the versions should be identical, but in my case the difference in the versions turned out to be insignificant, due to the slight “clutter” of custom fields and objects, as well as the short period of time.
But what was significant was that Bitrix released the day before a new version of the virtual machine on CentOS 9 Stream, since the old CentOS 7.9.2009 EOL went down on June 30, 2024. I had to start by transferring CRM B24 to a new VM, it’s probably worth writing a separate article about this article.

Installing ASPRO on the Bitrix 24 CRM host

Since you plan to have several sites on one host, I recommend handling http(s) traffic to them at the NGINX level. To do this using standard B24 tools, perform the following steps:

  1. Let's go to bash Bitrix VM menu #~/menu.sh

  2. In the menu you need to select the item Configure pool sites then Create a sitetype we indicate link .

  3. If you have already switched your domain to a new host, you can immediately add a certificate; I use Let's Enscrypt (I won't describe how to add it, it's easy to Google).

After these steps, you will have a new site added to the folder /home/bitrix/ext_wwwas well as 2 configuration files in /etc/nginx/bx/site_avaliable/
bx_ext_ssl_your.site.conf
And bx_ext_your.site.conf

  1. We go to the administrative part of the B24 portal Рабочий стол -> Настройки -> Настройки продукта -> Сайты -> Список сайтов press Добавить сайт fill in as follows:

Adding a Bitrix 24 website

Adding a Bitrix 24 website

Next, you need to install ASPRO itself; if the license has already been transferred and you have installed all the updates, then you will see Aspro in the list of Available Marketplace solutions:

Then you can immediately install ASPRO from the proposed button, or you can go to the List of Masters Рабочий стол -> Настройки -> Настройки продукта -> Список мастеров

install ASPRO using the wizard

install ASPRO using the wizard

At the first installation step, select the site created earlier in the admin panel:

Choosing a site

Choosing a site

Then we go through all the stages of installation, simultaneously choosing the same templates that were on the previous host in order to reduce our work in the future.

Once the installation is complete, you can open the ASPRO website using your domain name, in an incognito tab, or in another browser. Please notethat the user authorization information stored in the Session ID in cookies is tied to the domain name and when you try to log in within the same session, but on a different domain, the page on the login pop-up window will freeze.

Also, after installation, you will not be able to open pages of sections and information blocks, because… There is a known bug, the file is not filled out urlrewrite.phpbut that’s okay, let’s move on: Настройки -> Настройки продукта -> Обработка адресов -> Правила обработки and generate again:

Transferring general ASPRO settings

The simplest action, transferring only a small fraction of what is required.
Let's go here: Рабочий стол -> АспроАспро: Max -> Настройки -> Поделиться настройками

On the old host we perform action No. 1, but on the new host No. 2

On the old host we perform action No. 1, but on the new host No. 2

Transfer of information blocks

Here, too, everything is simple, but there is a nuance on which you can seriously get burned and “complicate your difficult life” as a developer/integrator (тыжпрограммиста).
The transfer of information blocks itself is described in Bitrix documentationI will not duplicate the instructions here. But the most important information is this: “the existence of an infoblock is checked only by the field External code“. On the old host, in 99% of cases, ASPRO is the only site on the Bitrix engine, so its ID is “s1”, and therefore all information blocks will have the postfix “_s1”, for example: aspro_max_catalog_s1 and on the new host, for example aspro_max_catalog_s2 since ID “s1” is used for the Bitrix 24 CRM site.
Therefore, it is necessary to automatically replace the ID of the old site with the ID of the new one in all xml files.
As a result, we do the following:

  1. We collect all export files (with folders, folders are created automatically) in a separate folder for each type of information block. I created 4 folders: “adverds, catalog, content, regions” and exported all available information blocks to them.

    folder structure for export/import xml infoblocks

    folder structure for export/import xml infoblocks

  2. Next, copy the folder to the new host, I also copied to the folder upload . And we do auto-replacement in *.xml files with the ID of the old site to the new one, you can use sed, you can use awk, I did this. We go to the main folder with all the subfolders of the imported infoblocks and execute there:
    #find -type f -name "*.xml" -print0 | xargs -0 sed -i -e "s/_s1/_s2/g"

  3. We import with the following settings. The main thing is not to confuse the types of information blocks, otherwise you will end up with duplicates with the same names, and you will have to separate the flies from the cutlets. To do this, it is important to organize the export files into folders corresponding to the types of information blocks.

    set to delete so that the demo data is automatically erased

    set to delete so that the demo data is automatically erased

  4. If you use “Product Offers” and the first time it was not possible to link them to products after import, then you must first download the “Product Catalog”, then “Product Offers”, attach “Product Offers” to “Products”, then delete “Product Offers” suggestions” and re-upload. But this is only if you failed with auto-substitution of site IDs, or if you import information blocks into an empty ASPRO (without demo data). It’s better not to do this, otherwise you’ll have to reassign the IDs of all infoblocks.

  5. And most importantly, the cherry on the cake, so to speak, now we need to replace the CRM catalog with the ASPRO catalog so that products from the ASPRO website appear in B24. To do this, in the PHP command line in the admin panel, write and execute:
    Bitrix\Main\Config\Option::set('crm', 'default_product_catalog_id', #ИД КАТАЛОГА#). Voila, B24 now has products from the ASPRO catalog, and no synchronization or exchanges are needed anymore.

  6. If your situation is different, when you need to pull up products from B24 to ASPRO, then the matter is even simpler, you can not transfer the “Product Catalog” and “Product Offers” at all, but simply replace the catalog in ASPRO aspro on CRM

Customizing the menu and home page

There is no universal recipe here. I did this: in one window I opened the old site, in the second the new one, and in the mode for editing the rules of the menu, details, telephone numbers. Where it was possible to open the template in code form, I copied and pasted the code.

Transferring changes made to templates

There is also no universal recipe for this point, you can transfer files by copying, you can copy-paste in window editor mode, it is important to pay attention to the ID of the information blocks, because they are guaranteed to be different. In case of differences, you will have to tinker a little to make matches.

Results

We discussed the problem of synchronization, CRM Bitrix 24 and the online store 1C-BUS, found a solution to transfer the online store to the same host with CRM Bitrix 24, which eliminates synchronization as such, and also saves money on purchasing and renewing a 1C license -BUS, not to mention the cost of setting up and maintaining synchronization.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *