Unable to export/import database

When trying to export a database on a source server with EXPORT DATABASE I receive:

`- Cluster 'target_1' (id=34)......command terminated with exit code 137`

Trying to do the same in orient studio it works perfectly fine and even fast. The final download is 700mb big (unzipped).

However the import over HTTP api (/import/) fails with:

java.lang.OutOfMemoryError: Requested array size exceeds VM limit
at java.lang.StringCoding$StringEncoder.encode(StringCoding.java:300)
at java.lang.StringCoding.encode(StringCoding.java:344)
at java.lang.String.getBytes(String.java:918)
at com.orientechnologies.orient.server.network.protocol.http.command.post.OServerCommandPostImportDatabase.execute(OServerCommandPostImportDatabase.java:51)
at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.service(ONetworkProtocolHttpAbstract.java:228)
at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.execute(ONetworkProtocolHttpAbstract.java:707)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:69)

What am I doing wrong?

Hi @jonsalvas

If you are doing it from console, you probably just have to give it a bit more Heap memory (ie. set -Xmx when you launch the console, see also the console.sh/bat file)



That did the trick, thank you Luigi! I am running the import right now. Hopefully it is also working this time.

Unfortunately not:

Connecting to database [remote:localhost/xxx] with user 'root'...OK
orientdb {db=xxx}> import database /tmp/export_20200128.export.gz

Importing database database /tmp/export_20200128.export.gz...
Error: com.orientechnologies.common.io.OIOException: Read timed out

Error: java.net.SocketTimeoutException: Read timed out

It ran for about 1h. Any ideas? :confused:

Hi @jonsalvas

It’s a networking issue, the import took too long in remote.

If you have a chance to do it, I’d suggest to stop the server and run the import in plocal.
Otherwise you can increate the network timeout (see https://orientdb.com/docs/3.0.x/admin/Configuration.html#network)



Hi Luigi,

I now managed to import using plocal. It was a bit unintuitive because the console did not accept my credentials for an earlier created database, so I had to recreate it in order to import. Further in a dockerized kubernetes environment it is not so easy to stop the database while keeping the pod active. Hopefully the export/import function will become easier in the future ;-).

Thanks anyway for your help