I am trying to use the following command from my PowerShell on Windows (with admin privileges) typedb server export --database=test_extended --port=1729 --data=data_export_20240104.typedb --schema=schema_export_20240104.tql in order to export the data and schema of Database that I have.
Unfortunately, the command opens a new shell that immediately closes. No logs, no errors. I’ve also tried typedb server export test_extended 1729 data_export_20240104.typedb schema_export_20240104.tql. Same result.
I succesfully upgrade the core version and migrated my database, but still I didn’t have success.
I keep getting this error:
Exception in thread “main” com.vaticle.typedb.core.common.exception.TypeDBException: [SRV10] Invalid Server Operation: Command line option ‘–schema’ requires a ‘’ value.
No matter what I write in --schema (I tried many different options). What the issue could be?
No, unfortunately I actually use double dashing, I past the error again without formatting it as quote:
Exception in thread “main” com.vaticle.typedb.core.common.exception.TypeDBException: [SRV10] Invalid Server Operation: Command line option ‘–schema’ requires a ‘’ value.
(I think it merges the double dashing into one by default, but in the row message I see two)
typedb server export --database=test_extended --port=1792 --data=C:\Users\seraf\Desktop\test_data.typedb --schema=C:\Users\seraf\Desktop\test_schema.tql
But I also tried several variation. With or without expliciting the path (e.g. using only the file name) using double and single quotes for the port number and for the path…
I tied also with different databases I have on the server, same error every time.
I tried also with forward slashes and double-checked again rn, and I got the same error.
Unfortunately, if I try to run the command without the schema argument (I actually don’t really need it since I have it in a .tql file anyway) I get a different error, saying that --schema agument is required.
There are no other options to export a database in order to use on another computer? Except recreating it from scratch.
We’ll spin up a windows test machine and check it out - this seems like a bug on our end We’ve reproduced it already and will get back to you re a fix.
This turned out to be an error with the .bat entry point, which currently accepts at most 9 arguments. server, export, and four flags with values add up to 10 args, the last of which is silently ignored.
This will be fixed in the next release. For now, to get unblocked you can edit the .bat manually. The fix is on line 67 (as of 2.26.x) start cmd /c java %SERVER_JAVAOPTS% -cp "%G_CP%" -Dtypedb.dir="%TYPEDB_HOME%" com.vaticle.typedb.core.server.TypeDBServer %2 %3 %4 %5 %6 %7 %8 %9 ^|^| pause
should be start cmd /c java %SERVER_JAVAOPTS% -cp "%G_CP%" -Dtypedb.dir="%TYPEDB_HOME%" com.vaticle.typedb.core.server.TypeDBServer %2 %3 %4 %5 %6 %7 %8 %9 %~10 ^|^| pause
(%~10 is the tenth missing argument)
Many thanks for your support on this matter. I modified the batch file as you suggested, but know when I try to connect the server I get this error:
Exception in thread “main” com.vaticle.typedb.core.common.exception.TypeDBException: [SRV07] Invalid Server Operation: All arguments should be prefixed with ‘–’, which ‘server0’ is missing.
FWIW, using double quotes seems to prevent CMD from splitting the arguments and works a treat: typedb server export "--schema=a.tql" "--database=test" "--port=1729" "--data=a.typedb"
Exception in thread “main” com.vaticle.typedb.core.common.exception.TypeDBException: [SRV10] Invalid Server Operation: Command line option ‘–data’ requires a ‘’ value.
This time it says --data instead of --schema because I used your syntax and data ended as the last argument. So I tried other possible comination just to check and I actually get throw different errors. (I tried both with quotations and without)
This if I have database as last argument (no matter how I write the database name):
Exception in thread “main” com.vaticle.typedb.core.common.exception.TypeDBException: [SRV10] Invalid Server Operation: Command line option ‘–database’ requires a ‘’ value.
And this is if I have --port as last argument:
Exception in thread “main” java.util.MissingFormatArgumentException: Format specifier ‘%s’