Cratedb getting table dump and loading the dump

Hello crate community. Is there any way to get a dump of a table in crateDB. Once I have that dump how would I load that dump into my cratedb instance?

Builtin there is

to copy / replicate tables between clusters. Depending on the amount of data another option might be to use an IDE like DBeaver to autogenerate insert / create statements.


Could you be more specific what exactly you are trying to achieve?

So Basically I have a dev instance of cratedb running. It has a table “scp_service_transaction”.“transactions_v2”. I want to take all the data in that table and put it into my local cratedb instance.

Ive tried

COPY "scp_service_transaction"."transactions_v2" TO DIRECTORY '~/' with (compression='gzip');

But I am getting the error

Error!

NotSerializableExceptionWrapper[unhandled_server_exception: Failed to open output: '~/transactions_v2_2_.json.gz (No such file or directory)']

Hi @arafaraf.

I am not completely sure about it, but I believe CrateDB will not support the ~/ idiom for addressing the home directory of the current user. That’s usually something only shells do.

With kind regards,
Andreas.

1 Like

I even tried

COPY "scp_service_transaction"."transactions_v2" TO DIRECTORY '~/temp/' with (compression='gzip');

and I am getting

Error!

UnhandledServerException[Failed to open output: '~/temp/transactions_v2_2_.json.gz (No such file or directory)']

Could you try the full path:

e.g.

COPY "scp_service_transaction"."transactions_v2" TO DIRECTORY '/home/username/temp/' with (compression='gzip');

instead of

COPY "scp_service_transaction"."transactions_v2" TO DIRECTORY '~/temp/' with (compression='gzip');
1 Like