How to setup and work with distributed infobases in 1C:Drive


Question: Our company has a head office in the capitol and regional offices in different cities of the country. The regional offices have their own 1C:Enterprise servers and their own 1C:Drive infobases running on these servers. How can I synchronize data between the head office and each of the reginal office infobases?

 

Answer: Since the configuration will always be the same through all of the infobases, you should use the distributed infobases functionality of 1C:Drive. You begin setting up the distributed infobases from the main infobase (head office infobase in our example).    

 

In the main infobase, Open Settings -> Data Sync. Activate the “Data Sync” tick box and designate the “This infobase prefix”. In our case the prefix is ”HO”, which stand for “Head Office”.  Afterwards, click “Data synchronization settings”.

1.png

 

“Data synchronization settings” window appears. Click the “New data synchronization” button.

2.png

 

Opens the “New data synchronization” window, click “Distributed Infobase” -> “Remote workplace (DIB full exchange)“.

3.png

 

“Data synchronization with Distributed infobase setup” window appears. Click “Configure connection parameters”. “Configure the distributed infobase” window opens. Here you have to determine where the data exchange file (the file to which exchanged between infobases data will be written and read by the infobases) will reside. The file can either reside on a local/network directory, on a FTP server, or created each time as an attachment to an e-mail. In our case we choose the local or network directory method: Activate the “Use local or network directory to synchronize data” tick box and designate the data exchange file’s place in the “Directory” field. Click “Next”.

4.png

 

Write the presentation and prefix of the correspondent application (the subordinate infobase). Let’s give it the prefix “EU” for “European” branch office. Presentation, which is indeed the name of the node (more on that later) will be “1C:Drive European Office” Then click “Next”.

5.png

 

Setup is finished, click “Finish”.6.png

 

Note that the first setup step “Configure connection parameters” has been completed successfully (with a big green tick to the left of it). Now click on the next step, “Configure data sending and receiving rules”. “Node of distributed infobase” window for the “1C:Drive European Office” node will appear. In this window, via “Data synchronization parameters” -> “Import object registration rules” it is possible to import custom “Object registration rules”. Object registration rules dictate changes in which objects (catalog types, documents types, chart of characteristics types types etc.) will be registered for a given node. These object registration rules are created in a separate 1C:Enterprise configuration called the “Data conversion” and saved as a .xml file. Click “Save and close”.

7.png

 

“Configure data sending and receiving rules” step has been completed. Click the “Create initial image of DIB subordinate node” step. “Creating the infobase initial image” window will appear. This is where the subordinate infobase, “1C:Drive European Office” having the “EU” prefix will be created from the main infobase. Choose where the subordinate infobase will be created. If the subordinate infobase will be created on a 1C:Enterprise server, we write the information of the server, along with the wan ip of the server, if it is a remote one. As our case is just for demo purpose and it is more convenient to do so, we choose “On this computer or on a computer in the local network” and select the infobase directory. Then click the “Create the initial image button”.

8.png

 

After a while the subordinate infobase will be created and you get the message about its successful creation. Just close the message then.9.png

 

In the main infobase, all three steps have been completed (green tick for every step). Now login to the newly created subordinate database, there we see that data sync has already been activated and the required data synchronization setting has been created. We set it up in the subordinate infobase too this time without the third step obviously.

10.png

 

Here, let’s explain what is a “node”. A node is an element of the “Exchange plan” platform object. It is used to keep track of which data has been changed in the infobase so that only this changed data afterwards can be exported to the data exchange file. The node which is created in the “1C:Drive:Head Office” (main)  infobase is called the “1C:Drive:European Office” because in this node, the changes to data that are made in the “1C:Drive:Head Office” (main) infobase  are recorded for export to the “1C:Drive:European Office” (subordinate) infobase. Changes are recorded in each node associated with a “Number of sent message”, this value is received from the “Number of sent message” attribute of the node at the time when the given change was made. During data export, only data associated with the registered changes whose “Number of sent message” is less than or equal to the current “Number of sent message” attribute of the node value is written to the data exchange file. After we finish the settings in the subordinate infobase too, the things will look like this:11.png

 

For some data change to be registered on the “1C:Drive European Office” node, let’s repost a Sales invoice document. We could have created a new document, new catalog element or could have changed a document or catalog element instead too, in either case the data change would be registered to the “1C:Drive European Office” node. Remind you again, the “1C:Drive European Office” node resides in the main (HO prefixed head office) infobase. And the  “1C:Drive Head Office” node resides in the subordinate (EU prefixed European office) infobase.12.png

 

Now in the main database (prefix “HO”), open the “1C:Drive European Office” node:13.png

 

And do the same in the subordinate (prefix “EU”) infobase too and show the nodes together on the screen. Take note that neither infobase has sent or received any data yet. Here we see that the reposting of the sales invoice document has been registered for the “1C:Drive European Office” node. Not only the document itself, but its records in the registers are also registered, that’s because the document will not be posted after it has been transferred to the target database, but it will be transferred together with its register records. This way, the slow posting process is omitted.  If we wanted to, we could register more objects or cancel the registration of registered objects by using the “Stage” and “Unstage” buttons.

14.png

 

A synchronization is always consisted of a data import from the data exchange file followed by a data export to the data exchange file. The sequence is always import first, export second.

FIRST STEP: We begin data synchronization by clicking the “Synchronize” button in the main infobase. Upon doing so, first the main infobase looks for incoming data (data whose sent message number is bigger than the received message number of the “1C:Drive European Office” node) in the data exchange file to import and cannot find it since this is the very first time we began synchronizing, no data has been sent (written to the data exchange file along with a sent message number) from the subordinate infobase yet, the “Number of received message” attribute of the node remains 0. Second, the main infobase exports data of the reposted document to the data exchange file along with sent message number 1, then sets the “Number of sent message” of the node to 1.

SECOND STEP: We click the “Synchronize” button in the subordinate infobase. Upon doing so, first the subordinate infobase looks for incoming data (data whose sent message number is bigger than the received message number of the “1C:Drive Head Office” node) in the data exchange file to import and finds it. It writes the data of the reposted document to the infobase and sets the “Number of received message” attribute of the node to the number of sent message that is mentioned in the data exchange file (which is 1), since this data has just been imported from the source infobase, it is not registered for the “1C:Drive Head Office” node as changed data (remind you the document does not get posted in the destination database, since it has been transferred with all its register records included). Second, the subordinate infobase exports data along with sent message number 1, then sets the “Number of sent message” attribute value of the node to 1. In our example no changes were made in the subordinate database, so no changes are registered for the the “1C:Drive Head Office” node. The subordinate infobase writes data to the data exchange file though, this data is the confirmation of the fact that the reposted document data which came from the main infobase  was successfully transferred to subordinate infobase.15.png

 

THIRD STEP: We click the “Synchronize” button in the main infobase. Upon doing so, first the main infobase looks for incoming data (data whose sent message number is bigger than the received message number of the “1C:Drive European Office” node) in the data exchange file to import and finds the confirmation data on the reposted document data which came from the main infobase  was successfully transferred to subordinate infobase. Upon receiving this confirmation, changes which were registered for the “1C:Drive European Office” node  with respect to the “Number of sent message” attribute value = 1 are cleared (in other words, unstaged)  and value of “Number of sent message” attribute of the “1C:Drive European Office” node is increased by one, to 2. Since no more changes were made in the main infobase in the meanwhile, no data was exported (no data written to the data exchange file).

16.png

 

It is possible to schedule the data import and export to the data exchange file. Scheduling is made separately in each infobase which take place in the data exchange.

17.png

Icon/Social/001 Icon/Social/006 Icon/Social/005 Icon/Social/004 Icon/Social/002