Windows TypeDB Export

Dear TypeDB community,

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.

Some useful info:

  • I can see and use the database from TypeDB Studio
  • Version of TypeDB is 2.23.0
  • Shell is running with Admin privileges

Anyone has an idea why it is not working?

Thank you.

Hi there -
I think this was fixed in 2.26.0 - do you mind trying that version of Core out?

You should be able to link the data directory/copy the data directly: TypeDB | Docs > TypeDB > Upgrading

Hi, many thanks for your answer.

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?

Did you try using --schema=<schema file> instead of a space --schema <schema file>?

Yes I never used spaces. Also, I use the same syntax I’m using for --data which doesn’t seem to throw me any error

The error message you showed uses a single - instead of a double -- , maybe that is the problem?

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)

Interesting - can you paste the entire command you ran again please?

Sure. This is the command I run:

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.


Many thanks for you help and patience

This works on my machine, which is a Mac:

> ./typedb server export --database=test-unicode --schema=/tmp/schema.tql --data=/tmp/data.typedb --port=1729

========================================================================================================
     ________ __      __ _____    _______  _____    _____       _______  _______  _____     _______
    |__    __|\  \  /  /|   _  \ |   _   ||   _  \ |   _  \    |   _   ||   _   ||   _  \  |   _   |
       |  |    \  \/  / |  | |  ||  | |__||  | |  ||  | |  |   |  | |  ||  | |  ||  | |  | |  | |__|
       |  |     \    /  |  |/  / |  |___  |  | |  ||  |/  /    |  | |__||  | |  ||  |/  /  |  |___
       |  |      |  |   |   __/  |   ___| |  | |  ||   _  \    |  |  __ |  | |  ||     <   |   ___|
       |  |      |  |   |  |     |  |  __ |  | |  ||  | |  |   |  | |  ||  | |  ||  |\  \  |  |  __
       |  |      |  |   |  |     |  |_|  ||  |/  / |  |/  /    |  |_|  ||  |_|  ||  | \  \ |  |_|  |
       |__|      |__|   |__|     |_______||_____/  |_____/     |_______||_______||__|  \__\|_______|

                                        THE POLYMORPHIC DATABASE
========================================================================================================
$x isa Export,
    has status "starting";

>

I wonder if it’s confused by the windows backslashes - can you try using forward slashes out of curiosity?

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 :slight_smile: We’ve reproduced it already and will get back to you re a fix.

1 Like

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)

1 Like

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.

That looks like you have %10 rather than %~10. %10 is interpreted as %1 followed by 0.

This is what I have, I pasted what you wrote in your comment, tilde included

My mistake, %~10 is the same as %10. Looks like the fix is non-trivial.

Ok, I see. Thank you anyway

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"

Unfortunately I keep getting the same error:

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’

I hope this may help