Skip to content

Instantly share code, notes, and snippets.

@shashank-shekhar
Last active October 3, 2023 18:36
Show Gist options
  • Save shashank-shekhar/3fa54fd6710a3cf199caf871a709817c to your computer and use it in GitHub Desktop.
Save shashank-shekhar/3fa54fd6710a3cf199caf871a709817c to your computer and use it in GitHub Desktop.
Backup and restore of neo4j database dump running in a docker container
# get container id
docker ps
$container = <container_id>
# backup here the database name is neo4j, replace it with the name of your databse
docker exec $container neo4j-admin dump --database=neo4j --to path/to/create/dump-file.dump
# this will stop the database inc case the dump fails.
docker $container neo4j stop
# restore database
neo4j-admin load --from=path/to/your/dump-file.dump --database=graph.db --force
# NOTE mount the host drive that you want the dumps to reside in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment