Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
379 views
in Technique[技术] by (71.8m points)

How to duplicate database in ArangoDB when you can't run arangodump

I want to make a clone/duplicate of a database I have in ArangoDB. This https://stackoverflow.com/a/27827457 is one way I saw to do it, but it doesn't work for me because I can't run arangodump or any of the other Arango commands (like arangosh, arangorestore, etc.).

Also, why can't I run arangodump? This answer https://stackoverflow.com/a/63074313 says to "Open terminal and use cd to go to the directory in which arangoimport.exe is stored", but I can't find arangoimport.exe anywhere.

I looked on the ArangoDB website already, but I couldn't find any info.

question from:https://stackoverflow.com/questions/65649404/how-to-duplicate-database-in-arangodb-when-you-cant-run-arangodump

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you don't have access to arangodump and arangorestore on server, then easiest way to invoke them is via docker and access your server by adding --server.endpoint option, you'll need to map some volume/directory to container to preserve dumped data for restoring them in other container, something like this:

#dump data to /tmp/dump at your host
docker run -it --rm -v /tmp/dump:/dump arangodb/arangodb:3.7.6 arangodump --server.endpoint http+tcp://192.168.1.2:8529
#restore data from /tmp/dump at your host
docker run -it --rm -v /tmp/dump:/dump arangodb/arangodb:3.7.6 arangorestore --server.endpoint http+tcp://192.168.1.2:8529

documentation of all available options, including examples are here for arangodump and here for arangorestore

other option is to write your own implementation of dump and restore utilizing ArangoDB REST APIs, but that's hefty and error prone task comparing to installing docker and then running provided dump and restore tools


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...