1s 8 ribs and added objects. Distributed Information Base: Basics

In 1C 8.3 or in 1C 8.2? Setting up a distributed information base. Step by step instructions.

Information base distribution is used when it is necessary to maintain joint records in databases that cannot, for various reasons, have physical connection. An example would be accounting for a company that has a division in a large city or small town without the ability to connect to the Internet. Or in some special cases of periodic need to simultaneously work with one database in the office and outside the office, for example at home. In such and similar cases, the use of a distributed information base (DIB) is justified and necessary.


In this article we will look at organizing the distribution of one information database in the 1C Accounting for Russia version 8.3 configuration through a local or network directory. In version 8.2 1C this instruction will also be useful, because describes essentially one process with significantly small differences.

==== Setting up for the main base ====

Having opened 1C 8.3 in the “Enterprise” mode, let’s go to the “Administration” section. In version 1C 8.2, to get started, you need to go to the main menu “Service” - “Distributed Information Base (DIB)” - “Configure RIB nodes”.

Next, we will consider the process in the context of information security version 8.3. So, going to the “Administration” section, select “Program settings”. In the settings, go to the “Data Synchronization” section. Here we check the box “Use data synchronization” and specify the database prefix. Let us indicate “CB”, implying a central base.

After this, the “Data Synchronization” item appears in the right menu. Let's choose him. In the child window that opens, click the “Set up data synchronization” button. In the drop-down menu you can select settings options for various cases using synchronization. We select “Distributed information base...”.

For general development, familiarize yourself with the contents of the next window and click “Next”.

In the next window, fill in the directory through which the . We will specify data compression to reduce the size of the upload, and you can immediately specify a password for the archive with the data. It is important not to forget him. Confirm the filling with the “Next” button.

The next two windows are intended for specifying settings parameters for cases of exchange via FTP server and through email. As stated earlier, we are considering the exchange method through a directory, so we are skipping the settings for FTP and email.

The next window is intended for specifying exchange parameters in the peripheral database part. Let's indicate its name and prefix. Next is the “Next” button.

Let’s check the exchange parameters we have created and confirm their correctness with the traditional “Next” button.

Will be created automatically necessary set settings for sharing. This will take some time.

Important! Creating the initial image for the slave node takes a significant amount of time. The size of this significance depends on the computer resources and the volume of accounting in the main database.

Let's assume that we decide to create an image. After clicking on the “Finish” button in the previous window, we will enter the settings to create an image of the slave information security. We will consider the simplest case for local operations. To do this, indicate the necessary details in the window that opens. Let us pay special attention to the parameter “ Full name file database". It must be indicated in full format UNC, which involves the formation of a local path in a “network” format. For example - “\\Server1C\Databases\RIB”. TO specified path Let's add the name of the database file - 1Cv8.1CD.

After clicking on the “Create initial image” button, the process of generating an image for the slave database starts.

After the process is completed, a database file will be created in the specified directory. This newly created database needs to be configured before full use.

==== Setting up for a peripheral base ====

To do this, you need to connect it to 1C. You will find how to do this in the instructions in our article - After connecting, you need to launch the new database in configurator mode and create users. Next, the information security needs to be launched in 1C “Enterprise” mode.

If, for some reason, the creation of users needs to be postponed to a later time, after connecting, you can simply launch the database in 1C “Enterprise” mode. You will be prompted to create an “Administrator” user, agree to it, and the initial filling will be done.

Then you need to continue setting up pairing with the main base. This setting is similar to that discussed above for the main database.

A setup for communication with the main base will be created.

============================================

So, now we have created the main and peripheral bases. Synchronization settings have also been created in each of these databases. Now you can move on to editing these settings and bringing them into a suitable form. You can create rules automatic exchange or perform the exchange manually.

Let's do this in the main database. The peripheral base is configured in the same way.

Editing can be applied to data synchronization rules and schedules.

By clicking the “Configure” button in the “Data synchronization schedule” section, you need to edit the scripts to automatically schedule the work of uploading/loading data for the selected database. You don’t have to edit it, just agree with the default options.

To edit the parameters, just click on the link with the automatic schedule data. And then we edit the temporary parameters for launching tasks. By going through the bookmarks you can change both the time and the dates and days of the week of the launch.

By clicking the “Run task” button in the main script window, you can execute manual start assignments.

By clicking the “Configure” button in the “Data synchronization rules” section, you can perform operations to change task launch scripts, as well as view the log of uploads/downloads. The latter is quite important for administering access and monitoring the regularity of exchanges.

Having finished creating and editing scripts automatic start exchange of a distributed database, you can proceed to unloading and subsequent loading of data.

At this point, the configuration of the distributed bathhouse database for the central and peripheral nodes is basically completed.

Download illustrated instructions

Distributed information base. Step by step instructions
Distributed Information Base (RIB) 1C:Enterprise
Creating a distributed infobase and setting it up
how to set up rib in 1s 8.2
How to set up a distributed information base in 1C
How to set up in 1C
How to set up in 1C
Setting up a distributed information base (RIB) in 1C
Example of setting up RIB for 1C:Accounting 8
Creation of a distributed infobase and configuration

Instructions for creating and configuring distributed databases using the URDB (URIB) component

The URDB (Distributed Database Management) component is used to exchange information between two identical 1C databases. If the configurations are different, then you can also use it, this is written in another. For the component to work, you must have the DistrDB.dll file in the BIN folder of the 1C: Enterprise program.

Let's look at the steps to create distributed databases. For example, we have a working base in the D:\base1 directory. It is required to make it central and create a peripheral base.

1. Create a directory D:\base2 for the peripheral database.

2. In the directories D:\base1 and D:\base2, create the folders CP and PC (use Latin letters).

3. Launch the central database configurator (D:\base1) and select Menu - Administration - Distributed Information Security - Management.

4. Click the “Central Information Security” button, in the window that appears, enter the code and name of the database. It is better to use numbers or Latin letters for the code. Enter, for example, 001 and “Central base”, confirm by pressing the “OK” button.

5. Click the "New peripheral information security" button to create a peripheral database. We enter the parameters for it: 002 and “Peripheral base 1”.

6. Use the cursor to select the “Peripheral base 1” base and press the “Setup” button. auto exchange". In the settings we change manual mode to automatic. Be careful, this is important.

7. Using the cursor, select the “Peripheral base 1” database and press the “Upload data” button, then the “OK” button. As a result of the upload, the file D:\base1\CP\020.zip will appear.

8. Launch 1C in configurator mode, add a new database “Peripheral database 1” in the 1C launch window, specify the previously created directory D:\base2 for it.

9. Select Menu - Administration - Distributed Information Security - Management. On asked question“The information base was not found. Do you want to load data?" Click the "Yes" button and specify the file name "D:\base1\CP\020.zip", click the "OK" button. After the download is complete, the process of creating a peripheral database can be considered complete.

In and also in the methods of creating a peripheral database by restoring a copy of the central database from a backup or attaching files of a copy of the central database for SQL format and executing the script are given. This will be useful for large volumes of data, when uploads and downloads take hours or are completely unrealistic.

Instructions for exchanging between distributed databases using the URDB (URIB) component

Let's consider a simplified example; we will perform the exchange manually by launching the configurator. You can use the batch mode of the configurator; to deliver exchange packages you can use mail, ftp, automatic copy files.

To perform the exchange, you must select Menu - Administration - Distributed Information Security - Auto Exchange. If the exchange is automatic (see point 6 of the previous instructions), then everything will work out.

1. So, we change or create some objects that migrate to the peripheral database. Object migration rules are set on the "Migration" tab in the object properties (see the object tree in the configurator).

2. Launch the central database configurator, select Menu - Administration - Distributed Information Security - Auto Exchange, click the "Run" button.

3. Move the resulting file D:\base1\CP\020.zip to the folder D:\base2\CP\

4. We change some objects in the peripheral database. Preferably not those that were changed before in the central database, because the central database has priority for object changes during exchange.

5. Launch the peripheral database configurator, select Menu - Administration - Distributed Information Security - Auto Exchange, click the "Run" button.

6. As a result of the auto-exchange, we should have changes coming from the central database. We should also have a file to transfer to the central database D:\base2\PC\021.zip

7. Copy the file D:\base2\PC\021.zip to the folder D:\base1\PC

8. Repeat point 2. As a result, changes received from the peripheral database will appear in the central database.

So, general principle exchange: alternately performing auto-exchange with simultaneous movement of files (exchange packages) from the PC folder of one base to the PC folder of another base and from the CP folder of one base to the CP folder of another base.

Configuration changes are made only in the central database. When changing the configuration, it is necessary to carry out the exchange in peripheral databases in exclusive mode. To successfully process packets from peripheral databases in the central database, the configuration must be loaded into the peripheral databases. If you get confused, it’s okay, the package rejected by the central database will be downloaded again.

In this material detailed instructions on setting up the RIB exchange for 1C:Enterprise 8 and the problems that the author encountered.

1. Creating nodes
We create new nodes (master and slave): in the user mode "Operations / Exchange Plans / Full"
Let's choose the exchange plan "Full"
We create two records:
- let’s call the first record “CB” (main node), indicate the code “CB”,
- let’s call the second entry “Subordinate node”, indicate the code “PU”.
Icon with a green circle - "CB" (main node)

For the slave node, click on the “Create initial image” icon. (Requires exclusive access)
Create a starting image
Next, in the window that opens, fill in the parameters of the new database. When finished, click the “Finish” button.
Creating an initial information security image
The creation of the initial image of the slave node of the distributed infobase will begin, and upon completion the message “Creation of the initial image has been successfully completed” will appear. Click the "OK" button.
We add the base of the slave node to the list of bases and launch it.
In this subordinate database we open the full exchange plan - the “CB” icon is red, this means that this node is the main node for the information base in which we are located.

2. Setting up prefixes
For each database, in the accounting parameters settings (in the UPP "Service / Accounting Parameters") on the "Data Exchange" tab, we set prefixes. This is done so that there are no conflicts in the numbers and codes of documents and directories created in two databases.
For automatic exchange, check the box "Use automatic exchange mechanism..."
Tab "Data exchange"

3. Add a setting for data exchange between nodes
Open: "Service\Distributed Information Base (RIB)\Configure RIB nodes"
Click "Add" and the "Data exchange settings" window will open.
Setting up data exchange

Click on the "Exchange according to current settings" icon
Execute the exchange according to the current setting

Now about the pitfalls
1. Data exchange can be carried out in automatic mode and can be initialized in the following cases:
* At starting the program. The exchange will be performed when the program starts,
* When you finish working with the program. The exchange will be performed before the user finishes working with the program,
* When the catalog appears. The exchange will be performed only if the directory specified by the user was invisible, but has now become visible. The setting can be used to perform automatic exchange when connected to a local network or flash cards. The program will periodically check the visibility of the directory specified in the settings and note its current state,
* When the file appears. It is recommended to use data mode when you need to exchange if an incoming data exchange file appears. In this case, it is enough to specify the full path to the incoming data exchange file. The program periodically analyzes the presence of the file, and as soon as it appears, the exchange will be performed, and after the exchange, this file will be forcibly DELETED (this is done so that the exchange procedure is not carried out constantly),
* Periodic data exchange. The exchange will be carried out according to the settings for periodic data exchange. If the infobase operates in file server mode, then periodic exchange is performed only for the user who is specified in the accounting policy settings as "User for routine tasks V file mode". In the Client-server version, the exchange is performed on the 1C:Enterprise server.

I have a Client-Server option - for routine auto-exchange to work, I had to overload the server

2. Windows encoding.
The exchange was interrupted by an error because the file was not compressed. This is due to a Cyrillic error in command line when compressed.
It can be treated by correcting the encodings in the registry.
For example, for Windows Server 2008 -
Code

REGEDIT4
"1250"="c_1251.nls"
"1251"="c_1251.nls"
"1252"="c_1251.nls"
"1253"="c_1251.nls"
"1254"="c_1251.nls"
"1255"="c_1251.nls"

3. When creating a copy of the database (for example, for modification) in the client-server version, it is NECESSARY that the ROUTINE TASKS OF THE COPY OF THE DATABASE be OFF. Blocking routine tasks for copy ON

If they are not blocked, then the copy will make exchanges on the same schedule as the main database. This means that some messages to remote nodes will be generated from the working database, and some from a copy, which will lead to desynchronization of configurations.

In this article we will talk about setting up a distributed database 1C Enterprise 7.7; the Trade Management 9.2 configuration will be used as an example.

To configure the RIB in 1C 7.7, you need to go to the configurator and go to Administration-Distributed IS-Management.

Then you need to convert your database to RIB, if it has not yet been converted to RIB, to do this you need to click the "Central Information Bank" button.

Set the Code and Description as in the screenshot above and click "OK". A warning should appear as in the screenshot below, ignore it and click “Yes”.
After this, your base will be ready to create peripheral nodes.

Click on the "New Peripheral IB" button and set the field values ​​as in the following screenshot, however, you can use your own designations.

Click OK and move on to the next step - setting up auto-exchange.

In this article I will tell you how to set up auto exchange using local network, if you need automatic exchange by mail, then leave your request in the comments or contact me at and I will tell you how to do it.

We display everything as on the slide, you can have your own paths to the directories, the checkboxes should be as in the screenshot above. Click OK.

Now we upload the initial image of the peripheral database to disk; to do this, click the “Upload data” button. After downloading the initial image, the RIB management window will look like this:

Let's assume that the computer on which our rib will work is located not far from the main computer with a central base and both computers are connected to a local network.

Now you need to configure the RIB to client computer, to do this, take our zip file downloaded in the previous steps and create an information base based on it. The screenshots below show the complete sequence of actions.

Click the "Add" button and point to an empty folder and click OK.

We select a new information security system and go to the configurator mode.

We create an empty information bank in an empty folder, so 1C asks us to indicate what format our database will be in, select *.dbf. Click OK.

Now let's load the zip file uploaded in the previous steps into our database; to do this, go to administration - download data.

Specify the path to the file and click OK.
Once the download is complete, click OK and go to administration-distributed ib-auto-exchange.



On this step it is necessary to take into account the rule: CB unloading directory = PB loading directory and vice versa, i.e. if in the central database we uploaded to the out folder and loaded from the in folder, then in the peripheral database we will load from the out folder and upload to the in folder. Click OK and move on to the next step. We perform automatic exchange. To do this, in the central database, go to administration-distributed ib-autoexchange.


Click the "Run" button, and then do the same on the client base. Perform the autoexchange operation on each computer several times.

Now let's automate the process. To do this, you need to create 4 files on each computer. 2 *.prm files and 2 *. bat file for each loading and unloading operation.

*.bat file must contain next line:

"<путь к файлу 1cv77.exe>"config/D"<путь к информационной базе>"/N<логин>/P<пароль>/@"<путь к prm-файлу>"

My loading and unloading files look like this:

"C:\Program Files\1Cv77\BIN\1cv7s.exe" config /D"C:\base\rib\" /Nadmin /P1 /@"c:\download.prm"

"C:\Program Files\1Cv77\BIN\1cv7s.exe" config /D"C:\base\rib\" /Nadmin /P1 /@"c:\upload.prm"

You write your values. Now let's deal with prm files!

Structure of the .prm file:

Section “General” – is intended to describe the main parameters of the batch mode. Possible parameters:

Output – path to the log file;
- Quit – whether the configurator needs to be terminated after completing all tasks;
- AutoExchange – whether autoexchange should be performed;
- SaveData – whether it is necessary to save the database;
- UnloadData – whether unloading should be performed;
- CheckAndRepair – whether the database needs to be tested and corrected.

Possible values ​​for these parameters can be 1(Y) or 0(N).

The “AutoExchange” section is intended for defining auto exchange parameters. Parameters:

SharedMode – indicates the mode of operation from the database. If the parameter is not specified, then exclusive mode will be used;
- ReadFrom - indicates from which databases data should be received. Database identifiers must be specified separated by commas. If all are needed, then put * ;
- WriteTo - indicates for which databases data should be uploaded. If it is necessary for everyone, then put *.

The “SaveData” section is intended for defining the parameters for saving the database. Possible parameters:

SaveToFile – indicates the path where saving will be done;
- FileList – indicates the list of files to be saved. File names are listed separated by spaces or commas;

Section “UnloadData” – is intended for defining parameters for data unloading. Parameters:

UnloadToFile – specifies the saving path, including the file name;
- IncludeUserDef – indicates whether the list of users should be included in the transfer file;
- Password – specifies the password that will be set to the transfer file.

The “CheckAndRepair” section is intended for defining database recovery parameters. Possible parameters:

Repair – indicates whether it is necessary to restore the database;
- PhysicalIntegrity – indicates whether it is necessary to check the physical integrity of infobase tables;
- Reindex – indicates the need to reindex the database;
- LogicalIntegrity – indicates whether it is necessary to check the logical integrity of tables;
- RecalcTotals – indicates whether it is necessary to recalculate the results of accounting and operational accounting;
- Pack – indicates whether it is necessary to free up space occupied by deleted records;
- SkipUnresolved – specifies whether to skip unresolved links or fix them;
- CreateForUnresolved – specifies how unresolved links are resolved. If 1, then an object of the appropriate type will be created for the unresolved link. If 0, then the link will be cleared.

Based on this, my files will contain the following:

to download from the central bank to the peripheral:


Output = log.txt
Output = 1


ReadFrom = CB

for unloading from the Central Bank to the peripheral:


Output = log.txt
Output = 1


WriteTo = CB

to download from the peripheral to the Central Bank:


Output = log.txt
Output = 1


ReadFrom = PB1

for unloading from the peripheral to the Central Bank:


Output = log.txt
Output = 1


WriteTo = PB1

Now it is enough to place the bat and prm files in one folder and run them one by one to perform downloading and uploading.

If you have any questions, feel free to comment!

Often in practice there are situations when different divisions or branches are geographically located in different places. At the same time, data entered into the program in remote departments must somehow get to the head office so that general records are maintained.

Currently this problem often solved by providing geographically remote employees remote access to a common base. It can be done by publishing the database on a web server, via a remote desktop, etc.

However, situations are not uncommon when there is simply no Internet in a geographically remote office, or it is not stable enough to work in a common information base. For this purpose, 1C has a mechanism for setting up a distributed database.

Simply put, the head office is where the main base is located. The remote department uses a subordinate. There may be several such slave bases. As a result, such a distributed database is united into one through synchronization. It can be done either automatically according to a schedule or manually.

In this article we will look at setting up a distributed database for 1C: Accounting 3.0. Despite this, the instructions are suitable for most other 1C 8.3 configurations.

Please note that all necessary configuration modifications should be made only in the main RIB database. During synchronization, these changes will be transmitted to all slave databases and take effect.

Main information base

When using a distributed database, the main settings fall on the main database. They need to be done in the “Administration” section, as shown in the image below.

In the window that opens, immediately check the “Data synchronization” checkbox. At the bottom, specify the prefix of the main (current database). It can consist of no more than two characters. In our case, the prefix will be “BG”, since we mean that this RIB 1C is “Main Accounting”.

Now you can begin setting up the synchronization itself, namely, specifying with which database (or databases) the data will be exchanged. To do this, follow the “Data synchronization settings” hyperlink. It will be available for navigation only if the checkbox on the left is checked.

In the window that opens, select “Full...” from the menu. It will allow us to specify any 1C information base for synchronization.

In the first window for connecting a subordinate database, which is located in a geographically remote office, check the box that the connection will be made through a local or network directory. In our case it is “D:\DB\InfoBase”. We will also check in advance whether you can write to it.

Be sure to specify different prefixes for different databases. The fact is that when synchronizing data, data overloaded from each database is assigned its own prefix. If they are duplicated, the work will be incorrect, so the program will not give you this opportunity.

When the program prompts you to create a startup image, select this option. This procedure will take some time, after which save it to your computer with the name “1Cv8.1CD”.

The synchronization itself can be done either automatically according to a schedule that you can set up yourself, or manually. In the second case, just click on the “Synchronize” button at a time convenient for you.

RIB slave node

The number of settings made in the slave database is significantly less. In the same section, set the “Data synchronization” flag and by clicking on the corresponding link, the “Synchronize” button will be available.

In our example, two item items were added to the main database: “Beam” and “Board”. After synchronization, they ended up in the slave database. As you can see in the picture below, they were given the prefix "BG". The remaining two positions (“Lathe” and “Pallet”) are assigned the prefix “BP”, since they were created directly in the subordinate database.

Please note that the numbering of elements in our case is continuous, but only within the same prefix.

Share