N
N
Nobody_Admin2018-10-04 01:14:48
1C
Nobody_Admin, 2018-10-04 01:14:48

How to create a database on a 1C server using the command line?

Good afternoon. I am doing my best to automate work with the 1C server, the question arose - how to create a new database? I dug into the manuals, wrote the following line, but the database is not created:

1cestart.exe CREATEINFOBASE /SSrvr="192.168.0.2\Tst";Ref="Tst";DBMS="PostgreSQL";DBSrvr="192.168.0.2";DB="Tst";DBUID="postgres";DBPwd="postgress_pass";SUsr="admin";SPwd="1cadmin_pass" /AddInList="Tst"

The base in Postgress does not exist at the time of the command execution. However, when I created it through PgAdmin, the situation did not change.
Where is the error? I suspect that the problem is in the connection parameters, but I did not find a single example of creating a database in this way.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Soplevenko, 2018-10-04
@Nobody_Admin

Good afternoon. Information about command line parameters is easily found in the help of 1C itself.
Here, for example, is an article about the "CREATEINFOBASE" parameter, with an example:
Here is a working Powershell code:

$path1c = "c:\Program Files\1cv8\common\1cestart.exe"
$arg1c = "CREATEINFOBASE Srvr=""localhost"";Ref=""test3"";DBMS=""PostgreSQL"";DBSrvr=""localhost"";DB=""test3"";DBUID=""postgres"";DBPwd=""159753"";CrSQLDB=""Y"";SchJobDn=""N""; /AddInList test3 /Out create.log"
Start-Process $path1c $arg1c

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question