📜 ⬆️ ⬇️

How to cook hundreds of bases 1C and not go crazy

The button is not the most common accounting company, but we keep accounting in 1C, like most domestic colleagues. At the moment, hundreds of bases reside on our server, so we had to learn how to administer all this wealth quickly and efficiently. If you are an accounting company, a hoster with 1C service, or you just have a bunch of 1Sok from somewhere, you know how difficult it is. We love to benefit, so we will share our experience, practical tips and insights that we managed to visit for countless nights, holidays and days off spent on updating and updating our entire farm.



We do not sell 1C, and therefore the story will be without cuts, censorship, and most importantly - without a marketing bulshit. Bonustrek, in the course of the post, you can find some useful scripts and tips for those who really have a lot of 1C bases.

So why do we have so many bases at all? In fact, right now we are exploring the technology of data sharing, but have not yet begun to use it, so for each business we serve, we are forced to create a separate database (and often not one).
')

Incredible way from cloud 1C to own server cluster


At the beginning of our journey, we used the cloud 1C-Frechet : this service is moderately convenient, as far as it can be convenient to use the desktop application through a browser. However, rather quickly we have accumulated fifty bases and it has become unbearable to administer them via the web - the web interface began to slow down, plus there was a need to programmatically integrate 1C with our internal tools, which Fresh is absolutely not able to do. I had to migrate, unloading all the data from the cloud. Fortunately, it was easy to do this (“Upload data to the local version” → “Load data from the service”).

The second important stage of evolution was the use of the service provider , and we, again, were satisfied with everything until the bases became more than a hundred. Configuration updates, as well as publication with the addition of users, took place through a letter to technical support. In principle, everything is operational, but not interactive.

Special inconvenience was caused by the inability to start. exe-files without prior approval (adding hash sums to the resolving domain policies), and we will remind you that integration was necessary. There were also problems with the fact that, for unknown reasons, the storage provider of the provider incorrectly synchronized the nodes at the block level. So we lost several important bases, which had to be long and painfully restored. With storage systems, things are often difficult and dishonest.

Mistress note: test storage. If you are a hoster, then pay more attention to this. If you use a third-party hosting - be sure to check the storage and drives. These are children's rakes, which are even harder to attack than adults :)

After all the adventures, we decided to migrate to your VPS. The power of modern virtual servers allows you to safely keep a couple of hundred 1C-bases , easily allowing them a couple of dozen accountants. VPS providers are often not responsible for licensing software products that you run inside, so you need to take care of purchasing a license for users and purchasing configurations.

Hostess note: when licensing a large number of databases, surprises can wait for you - activating each database for each user through a software key can be your main job in the coming weeks. The hardware key is deprived of this drawback, but you can't just take it and start using it in VPS.

Let's not forget that even the best VPS (selected using this cool service ) cannot be compared with a warm and lamp own server. We decided to migrate for the third time.

One evening, our VPS did not start. There was the very peak of reporting - the last of her hours, and the server was down for an unreasonably long time. At the same time, we could not do anything through the control panel - the server was in the launch stage, and technical support just waved its hands. As it turned out, our virtual machine ran out of RAM on the host, and it simply was not enough to launch it.

Total
Now, having hundreds of bases having gone from 1C-Farsh , through pain, migrations, database inconsistency, technical support incompetence, problems with host synchronization of nodes, web publishing, exports, imports, backups and a lot of restorations, we came to our server cluster .

What I would like to draw the attention of those who pass this way or are planning to take:

How to simplify life if you are forced to work with a bunch of bases


Creating a database with a link to it in the profile of the current user
We deploy all our databases from a pre-prepared template (with loaded treatments, reference books, customized ITS subscriptions and backups).

For the file option:
CHCP 1251 "%ProgramFiles(x86)%\1cv8\<>\bin\1cv8.exe" createinfobase File="X:\Base\habrahabr" /AddInList " " /UseTemplate "X:\tmplts\.cf" 

For SQL option:
 CHCP 1251 "%ProgramFiles(x86)%\1cv8\<>\bin\1cv8.exe" createinfobase Srvr="habr" Ref="HabraBD" SQLSrvr="habr" SQLDB="HabraBD" SQLUID="sa" SQLPwd="123" /AddInList " " /UseTemplate "X:\tmplts\.cf" 

How to create or delete a user immediately in a hundred databases?
User management has always been a sore point 1C. In earlier editions, this required to get exclusive access to the database files, later added the ability to add on the fly, but only through the configurator, now (in the latest editions of bookkeeping or trading) you can create a user directly from the main mode of operation, through administrative tools. But to do it with hands in the case of hundreds of databases is already unrealistic, so we learned how to add users programmatically. COM comes to the rescue. We establish an external connection V8.COMConnector and transfer to the database all the necessary information. We add users with access rights, fill out directories or create documents. See how .

How to connect the user immediately hundreds of databases?
To add all the necessary databases to the user list at once, we use the v8i file-lists of the common bases located on the file ball. Links to these files are added in the user profile (for example, through GPO or to the default profile) in the% AppData% \ 1C \ 1CEStart \ 1CEStart.cfg file:
 CommonInfoBases=X:\Base\List\Base_a1.v8i CommonInfoBases=X:\Base\List\Base_a2.v8i CommonInfoBases=X:\Base\List\Base_a3.v8i 

Or from the 1C itself (already under the user) we add the list of common information databases:



Inside, the v8i files look like this:
 [ ] Connect=File="X:\Base\Accounting\habrahabr"; ID= OrderInList=6062080 Folder=/ OrderInTree=6422528 External=1 App=Auto WA=1 Version=8.3 

You can create them directly from the database selection window (“Save link to file”) or take in the profile of the user who created the database -% AppData% \ 1 ° C \ 1CEStart \ ibases.v8i. The link can be to the database operating in any mode (file, server, web). We recommend storing no more than one hundred databases in one file, otherwise the file may simply not load to the end :)

How to update a hundred databases at once?
It is better to update the databases on a separate server (or even better on two at once :) - this is faster and it is easier to manage the process. We use typical configurations (without withdrawal from support), updated via ITS. In the first quarter of this year, for “Accounting 3.0” more than 10 updates were released, roll them even into a dozen of databases manually - that’s fun. Because we have developed some strategy.

Cool story: in the first reporting period of 2014, our favorite state bodies and 1C suddenly deprived us of sleep, releasing from March to April more than 10 updates just for the configuration of Bookkeeping 3.0! Of course, we did not update everything, but even 3-4 updates for hundreds of bases in such a short period of time are a good test of strength.
The reader may wonder where all this hassle is? The answer is simple: changes in legislation and at the same time at the very last moment. For example: from the beginning of 2014 there were no approved forms of the FSS and the FIU. In one of the first 10-ki updates added them, but only for delivery in paper form, but in the electron - no. And it happens all the time.

Lock
Through the interface:



Or through the creation of a file in the base directory 1Cv8.cdn with the following contents:
 {1,20140514173100,00010101000000,"   !  =)  :      ,       "1:"  : ENTERPRISE /F""X:\Base\habrahabr"" /C /UC< >","",""} 

Update
For the file option:
 CHCP 1251 SET cfu_file="X:\tmplts\1C\Accounting\3.0.32.7\1cv8.cfu" SET base_dir="X:\update\habrahabr" "%ProgramFiles(x86)%\1cv8\<>\bin\1cv8s.exe" CONFIG /F %base_dir% /N"" /P"123" /UpdateCfg %cfu_file% /UpdateDBCfg /Out update.log 

For SQL option:
 CHCP 1251 SET cfu_file="X:\tmplts\1C\Accounting\3.0.32.7\1cv8.cfu" "%ProgramFiles(x86)%\1cv8\<>\bin\1cv8s.exe" CONFIG /S"habr\HabraBD" /N"" /P"123" /UpdateCfg %cfu_file% /UpdateDBCfg /Out update.log 

How to backup databases?
If you use SQL, the next paragraph can be mercilessly skipped, it is relevant only for the file mode.

In our practice, we have repeatedly met the base in an inconsistent state. Moreover, in the file version, there are no special tools to inform the database about the start of copying, there is no way to block work with it if it is running right now. We coped with this in the following way: at midnight, the RDP server switched to the mode of prohibiting new connections, after a couple of hours all users gently drove out the script. Then the routine update and backup worked.

Upload to dt
For the file option:
 CHCP 1251 "%ProgramFiles(x86)%\1cv8\<>\bin\1cv8s.exe" CONFIG /F "X:\Base\habrahabr" /N"" /P"123" /DumpIB "X:\Backup\DT\habrahabr.dt" 

For SQL option:
 CHCP 1251 "%ProgramFiles(x86)%\1cv8\<>\bin\1cv8s.exe" CONFIG /S"habr\HabraBD" /N"" /P"123" /DumpIB "X:\Backup\DT\habrahabr.dt" 

All the above is true for 1C Enterprise, platform 8.3; Accounting 3.0; Salary and Personnel Management 2.5.

Next time we will talk about working in the data sharing mode for several hundred companies on one base. We will be glad to hear questions, comments and suggestions. And to all those who are faced with similar tasks - I would like to wish patience, perseverance and faith in victory.

Source: https://habr.com/ru/post/225027/


All Articles