Merge pull request #6755 from Ocelot-Social-Community/6754-add-neo4j-maintenance-mode-command-to-docker-compose.yml

chore(other): add tail command as template comment to `docker-compose.yml`
This commit is contained in:
mahula 2023-09-27 08:30:30 +02:00 committed by GitHub
commit 24112ce5d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -117,6 +117,8 @@ services:
# TODO: clarify if that is the only thing needed to unlock the Enterprise version
# - NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
# TODO: Remove the playground from production
# bring the database in offline mode to export or load dumps
# command: ["tail", "-f", "/dev/null"]
networks:
external-net:

View File

@ -51,6 +51,18 @@ in `backend/.env`.
Start Neo4J and confirm the database is running at [http://localhost:7474](http://localhost:7474).
## Operations on Neo4j
### Import Neo4j Dump Locally in Docker
To import a dump into Neo4j running in a Docker container:
- we need to set `command: ["tail", "-f", "/dev/null"]` in the Neo4j block of `docker-compose.yml` on top level so the Neo4j database is in maintenance mode
- copy the dump into the running Docker container: `docker cp /path/to/dump <docker-image>:/existing-directory-in-docker/`
- connect to the Docker containers Neo4j terminal: `docker exec -it neo4j bash`
- to load the dump into the database we need the following command in this terminal: `neo4j-admin load --expand-commands --database=graph.db --from /backups/neo4j-dump --force`
- leave the terminal by entering: `exit`
## Commands
Here we describe some rarely used Cypher commands for Neo4j that are needed from time to time: