Website Migration Between Servers 1C-Bitrix
Moving a Bitrix website between servers seems straightforward: copy files, transfer the database, change DNS. In practice, each step contains nuances that cost hours of debugging. Bitrix stores paths, domains, and settings in multiple places simultaneously — some are hardcoded.
Where Paths and Settings Are Stored
Before migration, know where Bitrix stores critical data:
-
/bitrix/.settings.php— database connection, host, port, database name -
/bitrix/php_interface/dbconn.php— legacy core, connection parameters (if still used) -
/bitrix/modules/main/include/prolog_before.phpand site settings in DB — domain is bound to site inb_langtable -
/bitrix/cache/and/bitrix/managed_cache/— cache that needs clearing after migration -
/upload/— media files, can occupy tens of GB - License key — bound to domain and server
Migration Process
Step 1. New Server Preparation
New server must meet Bitrix requirements: correct PHP version, extensions (mbstring, curl, gd, zip, xml, json), nginx/Apache with correct rewrite rules. For Bitrix 22+ — PHP 8.0–8.2.
.htaccess file or nginx config is copied with the site — it may contain custom rules necessary for site operation.
Step 2. Backup Files
# Archive files excluding cache and temporary data
tar -czf /tmp/site-backup.tar.gz \
--exclude='./bitrix/cache' \
--exclude='./bitrix/managed_cache' \
--exclude='./bitrix/stack_cache' \
/var/www/html/
Transfer /upload/ directory separately — it may contain gigabytes of media.
Step 3. Database Dump
mysqldump -u bitrix_user -p bitrix_db \
--single-transaction \
--routines \
--triggers \
> /tmp/bitrix_db.sql
The --single-transaction flag is critical for InnoDB — ensures consistent snapshot without locks during dump.
Step 4. Deploy on New Server
# Extract files
tar -xzf /tmp/site-backup.tar.gz -C /var/www/html/
# Import database
mysql -u bitrix_user -p bitrix_db < /tmp/bitrix_db.sql
Step 5. Update Configuration
Update /bitrix/.settings.php — database connection parameters:
return [
'connections' => [
'value' => [
'default' => [
'className' => '\Bitrix\Main\DB\MysqlCommonConnection',
'host' => 'localhost', // New DB host
'database' => 'bitrix_db', // Database name on new server
'login' => 'bitrix_user',
'password' => 'new_password',
'options' => 2,
],
],
],
];
Step 6. Change Domain in Database
Domain is stored in b_lang table:
UPDATE b_lang SET SERVER_NAME = 'newdomain.ru' WHERE LID = 's1';
Also check b_option for hardcoded URLs:
SELECT * FROM b_option WHERE VALUE LIKE '%olddomain.ru%';
And in b_iblock — fields DETAIL_PAGE_URL, LIST_PAGE_URL if absolute paths are used.
Step 7. License Key
After migration to new server or domain — move license key in Bitrix administrative panel (Settings → License). If server changed, may require contacting 1C-Bitrix support to transfer binding.
Step 8. Clear Cache
rm -rf /var/www/html/bitrix/cache/*
rm -rf /var/www/html/bitrix/managed_cache/*
rm -rf /var/www/html/bitrix/stack_cache/*
From administrative panel: Settings → Performance → Clear Cache.
Testing Before DNS Switch
Check via hosts file (without DNS change):
# /etc/hosts (on developer machine)
111.222.333.444 olddomain.ru # IP of new server
Checklist:
- Homepage loads
- Catalog and product cards
- Cart and checkout
- Personal account
- Administrative panel
- HTTPS — certificate installed and working
- Product images display
- Email notifications send
DNS Switch and Critical Window
DNS switch is done in off-peak hours. Lower TTL to 300 seconds 24–48 hours before migration. After DNS switch, both servers operate in parallel until full DNS update.
For e-commerce: during DNS propagation, orders may come to both servers. Solution — place 301 redirect on old server to new domain after verifying operability.
Execution Timeline
| Website Scale | Migration Duration |
|---|---|
| Small site (up to 10 GB, simple DB) | 4–8 hours |
| Medium store (10–50 GB) | 1–2 days |
| Large portal (50+ GB, complex integrations) | 2–5 days |
Proper migration ensures zero business downtime and full operability on the new server from day one.







