Alexey Alekseev welcome to my cozy little blog. How to set up information exchange between databases and programs Setting up synchronization in a peripheral database

Often in practice there are situations when different divisions or branches are geographically located in different places. At the same time, the data entered into the program in remote divisions must somehow get to the head office in order to keep a general record.

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 remote desktop, and so on.

However, such situations are not rare 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, in 1C there is a configuration mechanism distributed base.

Simply put, the main base is located at the head office. The remote department uses a subordinate department. There may be several such subordinate bases. As a result, such a distributed base is combined into one through synchronization. It can be produced as automatic mode scheduled or manually.

In this article, we will consider setting up a distributed database for 1C: Accounting 3.0. Despite this, the instruction is also suitable for most other 1C 8.3 configurations.

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

Main information base

When using a distributed database, the main settings fall on the main database. You need to make them 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 base). It can be up to two characters long. In our case, the prefix will be "BG", since we mean that this RIB 1C "Main Accounting".

Now you can start setting up the synchronization itself, namely, specifying with which base (or bases) the data will be exchanged. To do this, follow the hyperlink "Data synchronization settings". It will be available for transition only if the checkbox on the left is checked.

In the window that opens, select the item "Full ..." from the menu. It will allow us to specify any 1C infobase for synchronization.

In the first window for connecting a subordinate base located in a geographically remote office, check the flag that the connection will be made through a local or network directory. In our case, this is "D:\DB\InfoBase". We will also check the possibility of writing to it in advance.

Be sure to specify different prefixes for different bases. The fact is that when synchronizing data for data reloaded from each database, its own prefix is ​​set. If they are duplicated, the work will be incorrect, so the program will not give you such an opportunity.

When the program prompts you to create an initial image, select this option. This procedure take some time, then save it to your computer with the name "1Cv8.1CD".

Synchronization itself can be performed 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 convenient time for you.

RIB slave node

The number of settings made in the subordinate database is much less. In the same section, set the "Data synchronization" flag and clicking on the appropriate link, the "Synchronize" button will be available.

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

note that the numbering of elements in our case is end-to-end, but only within the same prefix.

In 1s 8.3 or in 1s 8.2? Setting up a distributed infobase. Step-by-step instruction.

Infobase distribution is used when it is necessary to maintain joint accounting in databases that cannot, for various reasons, have physical connection. An example would be accounting in a single firm with a division in big city and a small village without the ability to connect to the Internet. Or in some special cases of the periodic need to work simultaneously 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 consider the organization of 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 essentially small differences.

==== Setting 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 infobase (RIB)" - "Configure RIB nodes".

Further, we will consider the process in the context of IB version 8.3. So, going to the "Administration" section, select "Program settings". In the settings, go to the "Data Sync" section. Here we check the box "Use data synchronization" and specify the database prefix. We indicate "CB", implying a central base.

After that, the item "Synchronization of data" appears in the right menu. Let's choose it. In the child window that opens, click the "Set up data synchronization" button. In the drop-down menu, you can select options for settings for various use cases of synchronization. We select "Distributed infobase ...".

For general development, we get acquainted with the contents of the next window and click "Next".

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

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

The next window is intended for specifying the exchange parameters in the part of the peripheral database. Specify its name and prefix. Next - the "Next" button.

Let's check the exchange parameters that we have formed and confirm their correctness with the traditional "Next" button.

The necessary set of settings for the exchange will be automatically created. It will take some time.

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

Suppose we decide to create an image. After clicking on the "Finish" button in the previous window, we will enter the settings for creating the image of the slave IS. We consider the simplest case for local operations. To do this, specify the necessary details in the window that opens. Pay special attention to the " Full name file base. It must be specified in full UNC format, which assumes the formation of a local path in a "network" format. For example - "\\Server1C\Databases\RIB". Add the name of the database file to the specified path - 1Cv8.1CD.

After clicking on the "Create initial image" button, the process of generating an image for the slave base starts.

After the end of the process, a database file will be created in the specified directory. This newly created database must be configured before full use.

==== Setting up for an edge base ====

To do this, it must be connected to 1C. You will find how to do this in the instructions in our article - After connecting, you need to start the new database in the configurator mode and create users. Next, IB 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 start the database in 1C "Enterprise" mode. You will be prompted to create an "Administrator" user, agree to it, and the initial population will be performed.

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

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

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

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

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

Editing can be applied to the rules and data synchronization schedule.

By clicking the "Configure" button in the "Data synchronization schedule" section, you need to edit the scripts for the automatic work schedule for uploading/downloading data for the selected database. You can not edit, just agreeing with the default options.

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

By clicking the "Run task" button in the main script window, you can manually start the task.

By clicking the "Settings" 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 important enough to administer access and monitor the regularity of exchanges.

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

On this, basically, the configuration of the distributed database of bathhouses for the central and peripheral nodes is over.

Download illustrated instructions

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

Distributed technology information bases(RIB) allows you to create a geographically distributed system based on 1C Enterprise configurations. This allows you to have a common information space even with those departments that do not have a reliable communication channel, combining the high autonomy of the nodes with the ability to quickly exchange information. In our articles, we will consider the features and practical implementation of this mechanism on the 8.2 platform.

First of all, let's ask ourselves a question: why auto-exchange? Modern technologies, combined with inexpensive and fast Internet, allow you to organize remote work without any difficulty. The choice of methods is wider than ever: RDP, thin and web clients, networking when VPN help- there is something to think about. However, all these methods have one significant drawback - a strong dependence on the quality of the communication channel.

Even with the ideal work of the local provider, it is impossible to guarantee 100% availability of the communication channel. Problems with the backbone provider, lack of power supply, physical damage to the communication line and many other factors make this task unsolvable. At the same time, the inaccessibility of the infobase at a remote warehouse or retail store leads to significant losses. And finally, let's not forget that there are places (for example, industrial zones on the outskirts of cities) where it is expensive and / or problematic to bring a high-quality communication channel.

The RIB mechanism allows you to get rid of these shortcomings, each unit has its own copy of the information base with which you can work autonomously even in the complete absence of communication with the outside world. A small amount of transmitted information allows you to use any communication channel for the exchange, including the mobile Internet.

RIB on platform 8.2 is not something fundamentally new, representing further development URIB platform 7.7, only now this technology has become more accessible and easier. Unlike the URIB component, which had to be purchased separately, the RIB is an integral part of many typical configurations and works completely in user mode, allowing you to do without the Configurator even at the setup stage.

At this point, it would be time to move on to the practical part, but one more digression will have to be made. The fact is that the transition to the 8.2 platform, which seems to have already happened, in fact led to the emergence of two types of configurations: based on a managed application, "native" for the 8.2 platform, and adapted from 8.1, continuing to use outdated technologies and mechanisms. Since a significant part of the configurations (Enterprise Accounting, Payroll and Human Resources) are adapted or transitional, they cannot be discounted, therefore the first part of our article will be devoted to these configurations (essentially the 8.1 platform), while in the second we will analyze the auto-exchange settings for configurations based on a managed application (8.2 platform).

Let's consider a practical task: set up auto-exchange via FTP for the Enterprise Accounting 2.0 configuration. Despite the fact that RIB allows you to exchange using e-mail or file shares, we recommend using FTP, as the easiest and most reliable way connections. You can read how to set up your own FTP server in, or you can use the FTP service of any hosting provider.

First of all, we need to set up exchange nodes. To do this, run the configuration with administrator rights and select Operations - Exchange plans.

In the list that appears, select Full plan or By organization if one database keeps records of several firms and the exchange needs to be made only for one of them. In the window that opens, there is already one node - the central one, we need to edit it by specifying the code and name.

After that, we will create another node for the branch, filling it in the same way (to add, click the green circle with a plus). The next step is to create an initial image for this node, which is a ready-made infobase in file mode. To do this, click right click click on the required node and in the drop-down list select Create initial image.

Now let's move on Service - Distributed Information Base (RIB) - Configure DIB nodes.

In the window that opens, click the button Add and customize new exchange, specifying the remote host, exchange type (via FTP), and server connection settings.

Bookmark Automatic exchange allows you to configure the schedule of exchanges, exchange by events (start and end of work, etc.), these settings are made for the user on whose behalf the exchange will be performed, so make sure that he has the rights to exchange data.

Do not forget to specify the node prefix for numbering documents (otherwise you will receive different documents with the same numbers) in Tools - Program Settings, here you can also configure some other exchange settings. On the same tab, you should select a user to perform exchange tasks, if you do not do this, the schedule will not work. Remember that the exchange will be made only if given user signed in to the program.

This completes the configuration of the central node, now you need to make similar settings for the peripheral node by connecting the initial image as an existing IB. After that, you can start exchanging data. For control use Communication monitor, it allows not only to control the success of the upload / download, but also shows the collisions or pending movements that have occurred (if the user who made the exchange does not have enough rights to perform any actions in the database). Availability this tool allows you to quickly and efficiently solve various kinds of problems that arise during auto-exchange.

On this, the exchange setup can be considered complete and you can start working in distributed mode. Separately, it is worth dwelling on updating or making changes to the configuration. These actions are available only on the central node, all changes made will be automatically propagated to peripheral nodes on the next exchange. Automatic changes require that the edge base be in exclusive mode, otherwise you will need to run Configurator and execute Updating the database configuration manually.

This article will focus on setting up a distributed database 1C Enterprise 7.7, as an example, the Trade Management 9.2 configuration will be used.

To configure 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 been converted to RIB yet, for this you need to click the "Central IB" 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 that, 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 proceed to the next step - setting up auto-exchange.

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

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

Now we upload the initial image of the peripheral base to disk, for this we press the "Unload data" button. After unloading the initial image, the RIB control window will look like this:

Suppose 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, for this we take our zip file uploaded in the previous steps and create an infobase 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.

Select a new IB and go to the configurator mode.

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

Now let's upload the zip file uploaded in the previous steps to our database, for this we will go to administration - upload data.

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



At this step, it is necessary to take into account the rule: Securities unloading directory = IB loading directories and vice versa, i.e. if in the central database we uploaded to the out folder and downloaded from the in folder, then in the peripheral database we will upload from the out folder and upload to the in folder. Click OK and move on to the next step. We perform auto-exchange. To do this, in the central database, go to administration-distributed ib-auto-exchange.


Click the "Run" button, and then do the same on the client base. Perform the auto-exchange operation in turn on each of the computers 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 files for each of the upload and download operations.

*.bat file must contain the following line:

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

My upload and download 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 down your values. Now let's deal with prm files!

Structure of the .prm file:

The “General” section is designed to describe the main parameters of the burst mode. Possible options:

Output - path to the log file;
- Quit – whether it is necessary to close the configurator after all tasks are completed;
- AutoExchange – whether to perform auto-exchange;
- SaveData – whether to save the database;
- UnloadData – whether it is necessary to unload;
- CheckAndRepair - whether it is necessary to perform testing and repair of the database.

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

The “AutoExchange” section is designed to define the autoexchange parameters. Options:

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

The “SaveData” section is designed to define the parameters for saving the database. Possible options:

SaveToFile - specifies the path where the save will be made;
- FileList – specifies the list of saved files. File names are listed separated by spaces or commas;

The “UnloadData” section is designed to define the parameters for unloading data. Options:

UnloadToFile - specifies the save 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 for the transfer file.

The “CheckAndRepair” section is designed to define the database recovery parameters. Possible options:

Repair - indicates whether it is necessary to restore the database;
- PhysicalIntegrity – indicates whether it is necessary to check the physical integrity of the 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 will be resolved. If 1, then an object of the corresponding type will be created for the unresolved reference. 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 one:


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 put the bat- and prm-files in one folder and run them in turn to perform the download and upload.

If you have any questions - wellcome in the comments!

Almost every database user faces the problem of transferring data from one program to another, from one database to another. The 1C Enterprise system has built-in tools for organizing the exchange between such programs as Trade and Accounting or Payroll and Accounting. But often there are situations when it is necessary to transfer and receive information from the online store or to transfer data from programs of other companies, such as Microsoft Access or Microsoft SQL. And if, for example, you have an old 1C Trade and Warehouse 7.7 database and plan to introduce a powerful modern system based on 1C Trade Management 8.0, then you can’t do without converter programs. In this section, we will look at the exchange options, both built-in, in typical configurations, and those unlimited potentials that you can use to create your own exchange schemes.

Way Embedded Conditions Advantages Automation Developer
URIB

1C1C

Platform
  • Sharing external files
  • All databases have the same configuration
  • It is not possible to select a specific document or directory element, all documents of this type or the entire directory are involved in the exchange
  • Very high speed by working at the platform level
  • Ease of setup
  • Bilateral exchange (during one session)
  • Work with email
  • Automation with Configurator (batch file)
  • Firm 1C
    XML

    1C->1C

    Configuration
  • Sharing external files
  • Processes large amounts of information
  • The ability to create and customize a template without the participation of a programmer, using the "Data Conversion" configuration (Information Technology Support (ITS))
  • MAUD

    1C->1C

  • Sharing external files
  • Works with different configurations
  • Required fine tuning for every configuration
  • Embeds its modules in the configuration during installation
  • The ability to create and configure exchange rules without the participation of a programmer Options for any automation are possible using the built-in 1C language and setting exchange rules PB
    OLE Automation

    1C->1C

  • Exchange inside local network(base in base)
  • Works with different configurations
  • Requires customization for each configuration
  • High visibility of work, one base is integrated into another
  • Gives the user full control over the exchange process: filters, conditions, processing
  • Options for any automation using the built-in 1C language are possible
    Excel, Word

    msoffice
    1C

  • Sharing external files
  • Configuration required
  • Convenient for working with price lists, lists and downloading printed forms
    .txt, .csv,
    .dbf, .xml
    and etc.

    ...->1С

    Convenient for sharing with other programs and external equipment.

    Distributed Information Base Management (DRIB)(1C1C) - a component of the platform of the 1C Enterprise program, developed by 1C. Allows you to create multiple infobases in a single information space. The exchange is performed by uploading/downloading an external file in the Configurator mode.

    The main condition is a single configuration for all databases. Advantages this method this is a high speed of operation, the possibility of two-way exchange and almost complete independence from the configuration version. The disadvantages include the fact that it is not possible to transfer individual documents or elements of directories, only the entire directory (or rather, changes made since the last exchange) or all documents of the selected type (for the same period).

    It is convenient to use URIB for synchronizing directories and preparing databases for the subsequent use of another exchange method for transferring individual documents. And also if you use a low-speed modem line to transfer periodic copies of the database, since the transfer file contains only information about the changes made.


    An example of a dialog for creating a distributed database 1C Enterprise 7.7 and 1C Accounting 7.7: the existing database is taken as a basis, it is declared the Central database and the list of Peripheral databases is determined. Further, copies of the Peripheral bases are created from the Central Base, thus it is impossible to connect two initially separate bases in this way. It is allowed to change the configuration only in the Central database, after which, during the next exchange session, it will be automatically installed in all Peripheral databases.

    Exchange session dialog 1C Enterprise 7.7

    XML and Data Exchange Manager (MOD)(1C->1C) - very similar methods. By using specialized programs files are created - "Conversion Rules", which schematically indicate which object (reference book, document) how to transfer and how to convert it. Further, the exchange of universal processing of unloading and loading is carried out.

    The advantages of the methods are that exchanging databases can have completely different configurations, and information can be converted during transfer using the built-in 1C language. The disadvantage is the slowness of work and the complexity of setting up the "Conversion Rules". In particular, it should be taken into account that if you change at least one of the configurations, you will have to reconfigure the "Conversion Rules".

    The XML method is useful when updating configuration releases or when migrating from one program to another. IN typical configurations all built-in exchange methods, as well as their updates, are implemented based on the XML method.

    An example of an upload dialog with the loaded "Conversion Rules" for the exchange between 1C Trade + Warehouse 7.7 and 1C Accounting 7.7

    Download processing - downloads any xml file created by 1C Enterprise 7.7 using any "Conversion Rule".

    OLE Automation(1C->1C) - the method is based on the integration of one 1C Enterprise or 1C Accounting database into another. The main condition is that both databases must be in the same local network and the user must have access to any of them. The exchange procedure itself looks like this: in the program where documents need to be transferred, a document log of another program is opened in which these documents are located.

    With the help of special filters for selection and sorting, the user marks the documents that need to be transferred, after which these documents are downloaded with all the analytics, updating it in the directories if necessary.

    The main advantage is the visibility of this method, the user has the ability to fully control the process of exchange and conversion, receiving as a result, for example, instead of individual selected invoices, a consolidated document. The disadvantage is that the exchange occurs without creating a file with information, so this method is not suitable for working with forwarding by e-mail. The most convenient application is the integration of 1C Trade + Warehouse and 1C Accounting.

    An example of a dialog for loading documents from 1C Trade + Warehouse 7.7 to 1C Accounting 7.7. To begin with, a period is set, after filling the journal with documents, using filters and checkboxes, Required documents. The "Import" button loads the selected documents in accordance with the set Mode.