How to set up and use 1C Configuration Repository for 1C:Enterprise Platform

Question: How to set up 1C Configuration Repository so that more than one developer can work on the same configuration simultaneously?

Answer: It is technically possible to create a configuration repository working in file mode directly from the Designer, without using the 1C Repository Server. However, in our example we are going to show how to set up a 1C Repository Server. Using a repository server has the advantage of being able to publish the repository to internet so that the repository becomes accessible to clients not only locally, but via wide area network.

If you want to use the 1C repository functionality to its full potential, you have to:

  1. Set up 1C Repository Server
  2. Create a repository
  3. Publish Repository Server to internet via IIS

The first two steps will be explained below. The third step could be the subject of another article in the future.

Step 1: Set up 1C Configuration Repository Server

Create a folder on the server PC for repository storage. Give the 1C service user (USR1CV8) full permissions for this folder.

image-20231014190948-1.png

image-20231014191010-2.png

image-20231014191023-3.png

Install 1C Repository Server files from the 1C:Enterprise Platform distribution package.

image-20231014191042-4.png

image-20231014191053-5.png

image-20231014191105-6.png

image-20231014191116-7.png

Register and start 1C Enterprise Server Service. To do this, you need to run the crserver.exe file which is located in the /bin folder of the corresponding 1C:Enterprise Platform version folder. Then, run the Windows Command Prompt as administrator:

image-20231014191132-8.png

Now, run the commands as on the screenshot:

image-20231014191142-9.png

Some explanation of the parameters:

-instsrvc               :installs the service

-rmsrvc                 :removes the service

-d            :folder in which the repositories will be stored

-port      :the port which the repository sever will use. By default, this value is 1542

-usr        :user on whose behalf the repository server service will run. This user must have the “log on as a service” right. Moreover, this user must have full access to the repositories folder which is specified with -d parameter. 

-pwd     :user password

-start     :starts the service

-stop     :stops the service

On the Services tab of Task Manager, check that the “1C:Enterprise 8.3 Configuration Repository Server” service is up and running.

image-20231014191152-10.png

Create an exclusion in Windows Firewall and your router’s firewall for the port that was specified with -port parameter upon registering the service. (port 1542 in our example)

In the repositories folder specified with -d parameter upon registering the service (in our example, “C:\1C Repositories”), create a subfolder for the repository we are going to create during Step 2. Please note that this way we can create many different repositories for different configurations per repository server service.

image-20231014191205-11.png

Step 2: Create 1C Configuration Repository

Now that the service and the folders are ready, we can proceed to create a 1С Сonfiguration Repository from our infobase. In our example, 1C:Enterprise Server and 1C Configuration Repository services run together on the same server PC. Only one 1C infobase user, Administrator, will have the administration rights for the repository. Other two users, John and Jane, are developers whose individual infobases are connected to the repository.

Open the infobase in Designer as Administrator user. From the configuration menu, select “Create repository”.

image-20231014191220-12.png

image-20231014191230-13.png

If you haven’t already enabled modification of the main configuration, the system will prompt you to do it.

image-20231014191240-14.png

Enable modification with support enabled and continue.

image-20231014191249-15.png

Next, you will be prompted to enter the location of the repository. As we are using the repository server, but it is running locally and not over HTTP, we specify the location as:

tcp://<server name or IP address>/<name of the folder which we had created for repository storage>

Since the infobase is in client/server mode and 1C:Enterprise Server and 1C Configuration Repository services run on the same machine, we can specify “localhost” instead of server name or ip address.

 image-20231014191303-16.png

Now, create the first repository user. Enter a user name and password. This first user automatically gets administrator rights for the repository.

image-20231014191314-17.png

Now, wait a few minutes while the system creates the repository and writes the configuration of the infobase to the repository. Once the repository is ready, you will be prompted if you want to bind the infobase to the newly created repository.

image-20231014191323-18.png

Click “Yes” to bind the infobase to the repository. Note that the lock icons now appear on the configuration tree. These icons indicate that the corresponding objects are not locked in the repository by our user and therefore cannot be modified by our user.

image-20231014191334-19.png

Soon we will see how to lock the objects to be able to modify them. For now, in order to add the other two users to the repository, select “Repository administration”:

image-20231014191349-20.png

We already have the Administrator user which we had created while creating the repository itself. Create another user, name it 'John', and give John a password.

image-20231014191358-21.png

On the “Rights” tab, make sure John only has rights to Lock objects. Unless John is allowed to lock objects, he cannot modify them.

image-20231014191407-22.png

Now create another user, Jane, with the same rights as John.

image-20231014191418-23.png

Now the repository and its users have been created, and the users are ready to get connected to the repository and start working.

How to connect to the 1C Configuration Repository

The infobase from which we have created the repository is stored on the server. Generally, Administrator user connects to and works with this infobase, because he is the lead developer. The other two developers, John and Jane, work with their own infobases in file mode on their respective office computers. Let’s assume for now that you are John. Log on to your personal file infobase locally stored on your office computer.

Log on to John's personal infobase as 'Administrator(DE)' user. Note that 'Administrator(DE)' is John’s infobase user name, while his repository user name is 'John'.

image-20231014191434-24.png

Before trying to bind your configuration to the repository, allow modification of the main configuration.

image-20231014191444-25.png

image-20231014191453-26.png

Then bind your configuration to repository.

image-20231014191501-27.png

You will get a message stating that if you bind to the repository, configuration of your infobase will be replaced with the configuration of the repository. This means that you are going to lose parts of your configuration which differ from the repository’s configuration. Click “Yes”.

image-20231014191526-29.png

Enter the address of the repository. Please note that this time, instead of 'localhost', you need to specify the name of the server computer explicitly, since, unlike Administrator,  John is connecting not from the server machine, but from his own office computer. Enter the John’s user name and password. Note once again that repository users and infobase users co-exist: John’s infobase user is called 'Administrator(DE)', while his repository user is called 'John'. Click OK.

image-20231014191540-30.png

Now, wait a while for the system to write the repository’s configuration to John’s personal infobase. Once this is done, you will be prompted that the configuration has been successfully bound to the repository.

image-20231014191550-31.png

How to work with repository

Each user works with their own individual infobase. In there, a user can only modify the objects which they previously locked in the repository. While an object has been locked in the repository by a user, the other users of the repository cannot access that object. This ensures that only one developer at a time can work with an object.

image-20231014191603-32.png

image-20231014191615-33.png

image-20231014191626-34.png

image-20231014191634-35.png

image-20231014191647-36.png

After the user has finished modifying the object locked by them, the user updates the repository’s configuration with the configuration of their infobase using 'Store in repository' command. This command copies the changes the user had made in their individual infobase  to the repository configuration, and unlocks the object in the repository. Now, the newly modified object is once again available for the other users of the repository to lock and modify in their individual infobases. It is advisable for users to update their own infobases from the repository so that they maintain a fresh individual infobase.

image-20231014191656-37.png

image-20231014191712-38.png

image-20231014191718-39.png

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