We easily archive 1C to SELECTEL cold storage

I decided to share a good experience of archiving 1C databases to SELECTEL cold storage. I hope this article will relieve the headaches of 1C system administrators of small and medium-sized enterprises who cannot find in which cloud to store archives. Because I know from my own experience that now there is pain and suffering in this topic.

Why cold storage and why SELECTEL?

Cold storage is very cheap to store and load data into. Here, extracting data if necessary is more expensive, but not significantly.

In general, you can expect that it will cost 50-100 rubles per month with a daily backup of 20-50GB with support for 10-day versions.

For comparison, a comparable cloud of one of the Russian providers will cost 100 rubles per month.

But why not then take the cloud from the usual popular provider?

The fact is that, for some unknown reason, Russian cloud providers prevent the use of their products for the corporate sector. And they don’t do it explicitly. You will know this after the fact, typical problems:

  1. Synchronization is done only by programs from the provider. And they do not work as services – if the administrator is not logged into the server, archiving does not work.

  2. The cloud declares support for the WebDAV protocol, which could be used for automatic synchronization. But in practice, this protocol works only formally – it does not transfer large files and the speed is reduced to a complete loss of performance (the file is transferred for hours and as a result the connection breaks).

  3. The cloud recycle bin is not automatically emptied, but is included in the occupied space. Therefore, you need to write and maintain a trash cleaning script.

  4. Traffic restrictions that cannot be overcome even for money. For example: “During the month, you can upload a limited amount of files to your Drive – no more than two volumes of the Drive at your rate.”

Therefore, in the end, the choice is made towards a simple, transparent and reliable solution – cold data storage.

Why SELECTEL? I don’t know of any other cold storage facilities in Russia. There are storages directly from Amazon, but there are very difficult technical and organizational entry thresholds, payment in foreign currency. Yes, and it is risky now to store data abroad.

In SELECTEL you just create an account and you can use it! Moreover, the test balance is given immediately upon request, you can pay later.

Unfortunately, there is no access via WebDav, but there is access via FTP, which is convenient to work with scripts through the command line. The download speed in the storage can be estimated from the screenshot (3 megabytes per second):

Storage settings in SELECTEL

To register, you need an e-mail and a phone number. You need to register for a legal entity, if services are paid by bank transfer, or for an individual, if in cash. After registering on SELECTEL, confirmation is requested by SMS at the entrance, authorization in the browser lasts for quite a long time.

I usually create a separate profile for each client in Chrome so as not to get confused and switch.

After entering, we create a ticket in the “Balance, payment and reporting documents” section.

Brief wording: “Test balance to test cold storage“.

Message: “Please provide a test balance of 100 rubles for 14 days to check the cold storage for data backup, the estimated volume of sending data to the storage is 10GB per day, the total storage is 100 GB“. Data volumes can be indicated approximate, in practice just check the volumes. 100 rubles is enough for such checks.

When the test balance appears, go to the “Object storage” section.

Select the “Create Container” command:

Fill in container data:

We create a separate cold container, call it versions.

In the settings of the version container, we specify the storage of versions for 240 hours (10 days):

In the properties of the backup container, go to “Container Settings”:

We enable versioning for the backup container, we add versions to the name of the container for storing versions:

The result should be two cold containers:

Versioning will reliably protect data in case of data corruption by ransomware.

In the users section, specify a new password for the main storage user:

You can create an additional user if you wish.

Important! Use hyphens, plus, numbers and latin letters in your password. Other characters may be incorrectly interpreted in FTP archiving scripts.

FTP archiving settings on SELECTEL

For archiving to FTP, we will use the program WinSCP.

After installation, I recommend checking the connection to the cloud in the graphical interface.

FTP server address: ftp.selcdn.ru Login and password – from the storage user.

You can also use the console, run it with the command:

“C:\Program Files (x86)\WinSCP\WinSCP.exe” /console

And in turn enter the commands open, synchronize.

The ftp_backup_1s.txt backup script for WinSCP looks like this:

option batch on
option confirm off

# open ftp connection
open ftp://login:password@ftp.selcdn.ru

mkdir \backup\1s

# synchronize files to server
synchronize -criteria=size -transfer=binary remote "F:\Archive" \backup\1s

exit

Here login and password are the login and password of the storage user.

Local directory on the computer: “F:\Archive”

Remote directory on FTP: \backup\1s

The criterion for changing a file is changing its size, which is relevant for backup files.

Important! I had a local directory with Russian letters, in the WinSCP console it accepts Russian letters, but not in the script. It was not possible to solve this quickly, so I simply renamed the original local directory in Latin letters.

I use ftp_backup_1s.cmd as a script launcher, which should be placed in the same directory with the ftp_backup_1s.txt script:

"C:\Program Files (x86)\WinSCP\WinSCP.exe" /console /script="%~dp0ftp_backup_1s.txt" /log="%~dp0ftp_backup_1s_log.txt"

This script needs to be added as a task to the Windows scheduler, a few hours after the start of archiving:

I recommend that you pay attention to the following points:

  1. Check the “Run for all users” checkbox, then the task will work even if the administrator has not logged on to the system.

  2. Check the box “Stop the task running longer” and specify the time of 6 hours. The default is 3 days. If the script hangs, it will not work for 3 days.

File storage checks on SELECTEL

You can download files from the cloud for verification and compare them binary with the originals (for example, using Total commander). Match up:

Files can be downloaded via FTP and from a browser.

The date in the repository is based on the date the file was created, so it does not match the date of the original file. In the case of circular archives, this can be a bit of a problem.

Archiving user files on SELECTEL

Users’ work files (Word, Excel) can also be archived there if there is no need for their preliminary encryption. I usually create a data folder inside the repository and synchronize the data directories with the repository in the same way.

Expenses and balance

In the “Object storage – Consumption” section, you can get analytics on traffic, the number of requests and storage costs:

Similar Posts

Leave a Reply

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