1C-Bitrix S3 Storage: Scalable Migration Guide

Running out of disk space on the server? Or need to distribute files across multiple servers and synchronize uploaded files between them? Migrating `/upload/` to an S3-compatible storage (MinIO, Selectel, VK Cloud, Cloudflare R2) solves both problems—but only if configured correctly. Otherwise, Bitr

Our competencies:

Frequently Asked Questions

Latest works

  • B2B ADVANCE company website development
    B2B ADVANCE company website development
    1460
  • Website development for FIXPER company
    Website development for FIXPER company
    1019
  • Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    764
  • Development based on 1C Enterprise for MIRSANBEL
    Development based on 1C Enterprise for MIRSANBEL
    882
  • Website development on CRM Bitrix24 for DOLBIMBY
    Website development on CRM Bitrix24 for DOLBIMBY
    810
  • Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1166

Running out of disk space on the server? Or need to distribute files across multiple servers and synchronize uploaded files between them? Migrating /upload/ to an S3-compatible storage (MinIO, Selectel, VK Cloud, Cloudflare R2) solves both problems—but only if configured correctly. Otherwise, Bitrix will start recording file paths incorrectly. We often see projects where after migration, image links break or performance drops due to wrong bucket addressing. For seamless S3 storage Bitrix integration, choose the right provider. Our team has over 10 years of experience with Bitrix; we have configured S3 for catalogs of 100,000+ items and know all the pitfalls. For a quick and safe setup, contact us.

Why Move Files to S3?

Local disk is a bottleneck. It has limited capacity, doesn't scale, and requires manual monitoring. S3 storage gives you practically unlimited space, automatic replication, and API access. For Bitrix, this is especially important if the site runs in a cluster—all servers see a unified file system without NFS nightmares. S3 storage can cost half or less of local SSD—up to 2.5x cheaper—and upload speed is comparable when CDN is configured correctly. This storage cost optimization can save your business thousands annually.

Comparison of local storage vs S3:

Parameter Local Disk S3 Storage
Capacity Physical server limit From several TB to petabytes
Fault tolerance Depends on RAID Automatic replication across zones
Speed for new files Limited by disk IOPS Depends on provider, typically 100+ MB/s
Price per 1 TB ~$50/month (SSD) ~$20/month (S3 standard)
Integration with Bitrix Out of the box Via main.cloudstorages module
How to Configure S3 Storage for 1C-Bitrix?

Bitrix supports cloud storage via the main.cloudstorages module (official docs at dev.1c-bitrix.ru). It abstracts file handling through providers. For S3-compatible storages, use the amazon provider (compatible with S3 API). For a complete S3 storage turnkey solution, follow these steps.

Provider configuration is done at /bitrix/admin/main_cloud_storage.php. Parameters for S3-compatible storage:

  • Endpoint URL (for MinIO: http://minio:9000, for Selectel: https://s3.selectel.ru)
  • Key – Access Key ID
  • Secret – Secret Access Key
  • Bucket – bucket name
  • Region – region (for custom S3 often us-east-1)

Code configuration (for automation):

\Bitrix\Main\Config\Option::set('main', 'cloud_storage_active', 'Y'); \Bitrix\Main\Config\Option::set('main', 'cloud_storage_provider', 'amazon'); \Bitrix\Main\Config\Option::set('main', 'cloud_storage_endpoint', 'https://s3.example.com'); \Bitrix\Main\Config\Option::set('main', 'cloud_storage_access_key', 'ACCESS_KEY'); \Bitrix\Main\Config\Option::set('main', 'cloud_storage_secret_key', 'SECRET_KEY'); \Bitrix\Main\Config\Option::set('main', 'cloud_storage_bucket', 'bitrix-uploads'); \Bitrix\Main\Config\Option::set('main', 'cloud_storage_path', 'upload/'); 

Path Style vs Virtual Hosted Style: Why It Matters

The most common issue when connecting non-AWS S3 is incorrect bucket addressing. AWS uses virtual hosted style: https://bucket.s3.amazonaws.com/key. Most S3-compatible services support path style: https://s3.example.com/bucket/key.

The standard Bitrix module uses virtual hosted style. For services that don't support it (e.g., MinIO on a local network without wildcard DNS), you need to patch the provider class /bitrix/modules/main/lib/cloudstorages/amazon.php—add the parameter use_path_style_endpoint: true when initializing the AWS SDK:

$s3Client = new \Aws\S3\S3Client([ 'version' => 'latest', 'region' => $region, 'endpoint' => $endpoint, 'use_path_style_endpoint' => true, 'credentials' => [ 'key' => $accessKey, 'secret' => $secretKey, ], ]); 

Comparison of popular S3 providers for Bitrix:

Provider Endpoint Path style Price per TB/month Notes
MinIO http://minio:9000 Required Free (your own server) Local development, low latency
Selectel https://s3.selectel.ru Supported ~$22 Data centers in Russia, SLA 99.9%
VK Cloud https://hb.bizmrg.com Supported ~$20 CDN integration, Russia
Cloudflare R2 https://<account>.r2.cloudflarestorage.com Supported ~$15 No egress fees

How to Migrate Existing Files to S3?

After connecting the storage, Bitrix starts uploading new files to S3, but old ones remain local. For migration of existing files (upload migration S3), use the built-in utility: /bitrix/admin/main_cloud_copy.php. It launches an agent that transfers files from /upload/ to the storage in batches and updates paths in b_file.

Important during migration: the SUBDIR field in b_file stores the relative file path. After migration to S3, paths become bucket URLs. If migration stops midway, some files will be on S3 and some locally. Bitrix determines the file source by the EXTERNAL_ID field in b_file—if filled, the file is considered cloud.

Public Access and CDN

Files in S3 must be publicly accessible for direct image links. Configure bucket policy for public read:

{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::bitrix-uploads/*" }] } 

To connect a CDN in front of the bucket (CloudFront, Cloudflare), set the CDN_URL parameter in the module—Bitrix will generate public URLs through the CDN, while writes will go directly to S3. This provides a Bitrix CDN S3 backend for optimized content delivery. For high-traffic sites, this can reduce bandwidth costs by 40% compared to serving from a single origin.

What's Included in the Service

We provide turnkey S3 storage setup. Work includes:

  • Audit of current infrastructure and load estimation
  • Configuration of the main.cloudstorages module with correct endpoint and path style
  • Migration of existing files from /upload/ with integrity verification
  • Setup of bucket policies and CDN (optional)
  • Documentation for access and configuration
  • Technical support during implementation

Our engineers are certified in 1C-Bitrix and AWS. We guarantee correct file storage operation after migration—if issues arise, we fix them for free. Official 1C-Bitrix documentation on cloud storages.

Typical Mistakes When Setting Up S3
  1. Using virtual hosted style when the provider doesn't support it—files fail to upload.
  2. Not configuring bucket policy—users see 403 errors on images.
  3. Migration without checking b_file—paths remain local, files are duplicated.
  4. Migrating cache to S3—sharp performance drop due to latency.

Timeline and Pricing

S3 storage setup takes 3 to 7 days depending on file volume and migration needs. Pricing is determined individually after an audit, but clients typically save 30-50% on storage costs compared to local SSDs. Leave a request—we will evaluate your project and offer the optimal solution.

Order S3 storage setup for your Bitrix—we guarantee correct operation.

Contact us for a consultation on configuring S3 for your Bitrix project. We ensure stable file storage without surprises. Our cloud storage integration Bitrix ensures seamless operation across all environments.