Last active
October 3, 2023 18:36
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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