arangodbdatabase-backups

How to dump all databases with ArangoDB


I have ArangoDB running locally with databases, collections, data and graphs from several different projects in it. I'd like to back up everything so I can rebuild my system. I know how to do a backup of a single database, but because I have a bunch I'm hoping to do this in one shot.

Essentially, I'm looking for the ArangoDB equivalent of

mysqldump -u root -p --all-databases > alldb.sql

Obviously the ArangoDB equivalent of

mysql -u root -p < alldb.sql

Would be good to know too.


Solution

  • As of release 3.3, arangodump does not support dumping all databases at once. It is per database.

    To make it dump all databases, it can be invoked in a loop over all databases, e.g.

    # loop over all databases
    for db in `arangosh --javascript.execute-string "db._databases().forEach(function(db) { print(db); });"` # host, user and password go here...
      do
        arangodump --sever.database "$db" # host, user and password go here...
      done
    

    This will work if there is one user that has access privileges for all databases.