Eliminate Duplicate Customer Records in 1C-Bitrix

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Showing 1 of 1All 1626 services
Eliminate Duplicate Customer Records in 1C-Bitrix
Simple
~1 day
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1359
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    947
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    694
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    832
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    732
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1075

Unified Customer Profile in 1C-Bitrix

Imagine a customer ordering a product on the site, then calling the call center from a different number, and later logging in through the app without authorization. The database holds three separate records, and the manager cannot see the full purchase history. On large projects, the duplication rate reaches 15–20% — for 100,000 records, that's up to 20,000 duplicates. This classic problem is solved by establishing a unified customer profile in 1C-Bitrix. We set up such a system turnkey: from table auditing to automatic merging. Over 80 projects integrating Bitrix and Bitrix24 have been completed. Our experienced team of certified 1C-Bitrix developers guarantees a smooth migration. Contact us for a database audit.

Why Is a Unified Profile Important?

Without a unified view, up to 20–30% of revenue is lost. For a client with 50,000 orders per month, duplication leads to 10,000 lost orders annually. Our bitrix deduplication service reduces this to near zero.

Causes of Duplication and User Data Structure

A typical scenario: a user places an anonymous order, then registers, but the guest session is not linked. The system creates a new record in b_user, while old orders remain with USER_ID = 0. If a lead with the same phone is registered simultaneously in the CRM, there are two duplicates. On databases with 500,000+ records, the duplicate percentage reaches 15–20%. We have seen this on projects with thousands of daily orders.

The core operates with two independent entities: user (b_user) and buyer (b_sale_person_type + b_sale_order_user). When an anonymous order is placed, a record is created in b_sale_order with USER_ID = 0 and contact data in the b_sale_order_props_value fields. Upon registration or authorization, orders are linked to a specific USER_ID, but the connection "guest orders → registered user" is not built automatically. Additionally: if the CRM module is installed, each order triggers the OnSaleOrderSaved event, which creates or updates CCrmContact and CCrmDeal entities. Duplication at the b_user level immediately causes duplicate contacts in the CRM. Without intervention, the number of duplicates grows exponentially. Our approach includes a thorough b_user audit to identify all duplicates. Proper CRM integration is essential to prevent future duplicates.

How Does Duplicate Detection Work?

We use deterministic fields and advanced matching. In one case, we reduced duplicate rate from 20% to 0.5%. Implementing bitrix user merge via CUser::Merge ensures consistent results. Our bitrix profile setup includes automated detection scripts.

Profile Merge Mechanism

A unified profile is built through three components:

  1. Identification by deterministic fields. Email and phone are the primary merge keys. In the b_user table, the EMAIL and PERSONAL_PHONE fields should be unique (index UQ_USER_EMAIL). The problem is that Bitrix does not prohibit two users from having the same phone if it is stored in user-defined properties via b_user_field.

  2. Merging via the user API. When a duplicate is detected, CUser::Merge() is called — this method transfers all orders, subscriptions, bonus points to the master account and deactivates the duplicate. It is important to check dependent tables first: b_sale_order, b_sale_fuser, b_rating_vote, b_forum_user, b_subscribe_subscriber. CUser::Merge documentation Source: Bitrix Developer API

Example merge code
// Merge: all duplicate data is transferred to the master user
$result = CUser::Merge($masterUserId, $duplicateUserId);
if (!$result) {
    $GLOBALS['APPLICATION']->GetException();
}
  1. The b_sale_fuser table (fake user). This is the key table for anonymous sessions. Each guest gets a record in b_sale_fuser with USER_ID = NULL. Upon authorization, the CSaleUser::DoAutoLogin() method should link the FUSER_ID to the real USER_ID. If this step is missed, the cart and incomplete orders remain "suspended" and do not appear in the profile.

User-Defined Fields and Guest Session Linking

Additional customer attributes (date of birth, gender, preferences) are stored in b_uts_user — a table automatically created for user-defined fields (UserTypeEntity with ENTITY_ID = 'USER'). When merging with CUser::Merge(), these data are not automatically transferred — the method copies only the main b_user table fields. It is necessary to manually transfer values from b_uts_user before calling the merge. This order history transfer is critical for data integrity.

The standard handler OnAfterUserAuthorize fires on every login. It is convenient to implement the following:

AddEventHandler('main', 'OnAfterUserAuthorize', function($fields) {
    if ($fields['USER_ID'] > 0) {
        // Transfer the guest's cart to the authorized user
        $fuserId = CSaleUser::GetAnonymousUserID();
        CSaleBasket::TransferBasket($fuserId, $fields['USER_ID']);
    }
});

Resolving Duplicates with CUser::Merge

On one project with a catalog of 150,000 products, we found 12,000 duplicate profiles. After configuring the merge via CUser::Merge, the entire queue was processed in 4 hours — automated deduplication is 3 times faster than manual methods. The client no longer lost orders; the number of anonymous carts decreased by 87%. CUser::Merge documentation Bitrix Developer API

Why Is a Unified Profile Critical in e-Commerce?

Without merging the customer database, up to 20–30% of revenue is lost — customers leave without seeing order history, managers waste time on manual merging. A configured mechanism provides a unified view, speeds up order processing by 2–4 times, and reduces delivery errors. Maintenance budget savings can reach 40%. For a typical project with 100,000 users, you can save over $5,000 annually. Order an audit of your database — evaluate the savings.

How Does Profile Merging Impact Performance?

Merging via CUser::Merge() is a fairly heavy operation: it overwrites several tables, updates the cache, and triggers agents. On databases with hundreds of thousands of users, the process can take up to 30 seconds per 100 duplicates. On a database of 200,000 users, the full merge completes in about 4 hours. To avoid hanging the user interface, we run the merge as an agent with asynchronous execution. For this, a queue of duplicates is created in a separate table, and the agent processes 100 duplicates per run.

CAgent::AddAgent(
    "CMergeAgent::ProcessBatch(100);",
    "main",
    "N",
    60
);

Step-by-Step Merge Algorithm

  1. Table audit — scan b_user, b_sale_fuser, b_uts_user for duplicates by email and phone.
  2. Index configuration — add unique indexes on key fields to prevent new duplicates.
  3. Deduplication script — determine the master account (by registration date or order count) and run CUser::Merge.
  4. Automation — attach a handler to OnAfterUserAuthorize and an agent for periodic cleanup.

What Is Included in the Work

Stage What We Do Result
1. Audit Scan b_user, b_sale_fuser, b_uts_user for duplicates Report with duplicate count
2. Design Determine merge strategy (email or phone) Logic documentation
3. Implementation Write deduplication scripts and handler Working merge mechanism
4. Testing Run on a database copy Loss-free protocol
5. Deployment Launch agent, train staff Database without duplicates

Timeline: from 5 to 15 days. Cost is calculated individually, starting from $2,500 for standard setups. Budget savings up to 50%.

Deliverables

  • Comprehensive documentation of merge logic and scripts
  • Access credentials to all systems and repositories
  • Staff training on unified profile management
  • Post-launch support for 30 days

Our deliverables include thorough documentation, full access, training, and support. Contact us for integration consultation.

1C-Bitrix Development Expertise

With over 80 projects, our team brings deep 1C-Bitrix development experience, including bitrix profile setup, CRM integration, and custom deduplication solutions. We ensure seamless order history transfer and data consistency.

What Professional 1C-Bitrix Installation Includes

We start by checking innodb_buffer_pool_size. The default MySQL value (128 MB) is a death sentence for an online store with a catalog of 10,000+ items. We set 70–80% of available RAM on a dedicated server, 50% on VPS. This single setting speeds up the site by 2–3 times compared to the default. We'll assess your project in one day — get a consultation. Contact us to order turnkey installation with performance guarantee.

How to Choose Hosting and Edition for 1C-Bitrix Installation?

BitrixVM is a virtual machine with a pre-installed stack: nginx + Apache, PHP-FPM, MySQL/MariaDB, Sphinx, Push server. For VPS — the best start. Everything is already configured for Bitrix, including OPcache, log rotation, and firewall. Management via web panel on port 8890. Bitrix documentation recommends starting with BitrixVM for predictable performance.

VPS/VDS is the sweet spot. Minimum configuration for a medium online store: 2 vCPU, 4 GB RAM, SSD. Optimal: 4 vCPU, 8 GB RAM. OS: Ubuntu 22.04 or Debian 12. If not BitrixVM, we configure the stack manually for the task. Virtual hosting — only for business cards and landing pages. Requirements: PHP 8.0+, MySQL 5.7+ / MariaDB 10.0+, 512 MB RAM, .htaccess. 1C-Bitrix hosting partners guarantee compatibility. Dedicated server — for highload. Typical architecture: web server separate, database separate, Redis/Memcached separate. For Enterprise edition — web cluster with load balancer. Cloud (Yandex Cloud, VK Cloud, Selectel) — when load spikes: sales, seasonal peaks. Autoscaling via Managed Kubernetes or simple VM vertical scaling.

Choosing the edition is equally important. A common mistake: choosing "Small Business" for a store that grows to B2B with wholesale prices and three warehouses in six months. Upgrading to "Business" — pay the difference, data is not lost, but it's better to plan ahead. Our specialists select the edition for current tasks and with room for growth. For example, the "Business" license (about 35,000 RUB) pays off through multi-warehouse and 1C exchange, while the wrong choice can lead to a loss of up to 30,000 RUB monthly on excess resources.

Edition For Whom Key Limitation
Start Business cards, landing pages No infoblocks 2.0, no trade catalog
Standard Corporate sites No e-commerce module
Small Business Small stores 1 price type, 1 warehouse, no 1C exchange
Business Medium stores, B2B Multi-warehouse, multicurrency, CommerceML
Enterprise Highload, cluster Web cluster, CDN, multisite

What Server Settings Are Critical for 1C-Bitrix?

Web Server and PHP

nginx as reverse proxy + Apache (mod_php) or nginx + PHP-FPM directly. The second option saves memory — Apache is not needed. But some Bitrix modules use .htaccess, so for compatibility we sometimes keep Apache. nginx configuration: fastcgi_read_timeout 300 — for long operations (1C import), client_max_body_size 1024m — large file uploads. Block access to .settings.php, .settings_extra.php, bitrix/.settings.php — they contain database passwords. Rewrite rules from urlrewrite.php — Bitrix generates them, but with nginx + PHP-FPM they need to be duplicated. PHP 8.0–8.2 with extensions: mbstring, curl, gd, xml, json, opcache, redis/memcached. Key php.ini settings: opcache.memory_consumption=256, opcache.max_accelerated_files=20000, max_execution_time=300, memory_limit=512M, upload_max_filesize=100M, post_max_size=128M.

Database and Caching

MySQL/MariaDB. Key my.cnf parameters: innodb_buffer_pool_size — 70–80% RAM, innodb_log_file_size=256M, tmp_table_size=256M, max_heap_table_size=256M, thread_pool_size — number of CPU cores. Encoding utf8mb4 mandatory, otherwise emoji and special characters break. Redis is preferable to Memcached for Bitrix — supports persistent connections and is more reliable. In production, Redis handles concurrent writes three times faster than Memcached under typical load. Configure in .settings_extra.php:

'cache' => ['value' => ['type' => ['class_name' => '\\Bitrix\\Main\\Data\\CacheEngineRedis']]]
'session' => ['value' => ['mode' => 'default', 'handlers' => ['general' => ['type' => 'redis']]]]
Example Redis configuration for Bitrix
sudo apt install redis-server
sudo systemctl enable redis

Add to .settings_extra.php as above.

SSL, Email, and Cron

SSL — Let's Encrypt via certbot in 90% of cases. Redirect HTTP → HTTPS (301), HSTS, TLS 1.2/1.3, OCSP Stapling. In Bitrix, switch to HTTPS in the main module settings. Email: abandon mail() — connect SMTP (Yandex.Mail for domain, Mail.ru for Business). Be sure to configure SPF, DKIM, DMARC. Without SPF, emails go to spam. Test deliverability via mail-tester.com — score 9+/10. Cron: Bitrix agents switch to system cron — * * * * * /usr/bin/php /var/www/bitrix/modules/main/tools/cron_events.php. Schedule 1C exchange (15–60 min), search reindex, backups (mysqldump + rsync, rotation 7+4), temporary file cleanup.

Security and Administration

File system: owner www-data, directories 755, files 644, upload 775. nginx blocks access to configuration files. Enable Bitrix Proactive Protection — WAF, activity control (block after 5 failed attempts), kernel integrity check. For admin panel: two-factor authentication via Google Authenticator or OTP, restrict access by IP via nginx for paranoid.

How Long Does 1C-Bitrix Installation and Configuration Take?

Task Timeline
Installation on virtual hosting 2–4 hours
Installation on VPS with stack configuration 1–2 days
Installation on dedicated with architecture design 2–5 days
SSL + email + cron + security 1–2 days
Backup and monitoring setup 0.5–1 day

Post-Installation Checklist

  1. Performance Monitor (/bitrix/admin/perfmon_panel.php) — aim for 30+ points. Below 20 means serious configuration issues.
  2. System Check — automatic check of all parameters. Red items must be fixed, yellow — case by case.
  3. Security Scanner — check for typical vulnerabilities.
  4. PageSpeed Insights — TTFB < 200ms on VPS, LCP < 2.5s.
  5. Test 1C exchange — if integration is planned, verify CommerceML exchange before launch.

Additionally, check software versions, caching settings, cron operation, SSL certificate, SPF/DKIM/DMARC, access rights, delete default users and pages. For projects with 54-FZ, ensure fiscalization is configured via OFD provider.

Deliverables

  • Fully configured server for 1C-Bitrix with MySQL, PHP, nginx optimization.
  • Installed and activated license of the required edition.
  • SSL certificate, email settings, cron and backups.
  • Documentation: all configuration parameters, access credentials, cron tasks.
  • Content manager training: how to log into admin panel, add products, upload images.
  • Post-installation support for 30 days — consultations on settings.

Why Trust Professionals with Installation?

Incorrect installation means lost time and money. We've seen projects where a store on "Start" couldn't handle 50 visitors because innodb_buffer_pool_size wasn't configured. After migrating to VPS with correct configuration, the site "flew". Incorrect configuration can cost 30,000 RUB monthly due to excessive resource consumption. You get a ready-made architecture that scales. Order turnkey 1C-Bitrix installation — get a reliable platform for business growth. Contact us for a free consultation: we'll calculate the cost and time for your project. Over 7 years of experience, 120+ Bitrix projects implemented, including highload stores with million-item catalogs. Get in touch — we'll help configure Bitrix for your project.