Remove '--database=neo4j' and '--expand-commands' from all the database commands

This commit is contained in:
Wolfgang Huß 2023-12-12 16:13:46 +01:00
parent af1de3d4a2
commit 0b8407ccff
3 changed files with 6 additions and 4 deletions

View File

@ -30,7 +30,7 @@ ${SCRIPT_DIR}/cluster.neo4j.sh maintenance on
echo "Dumping database ..." echo "Dumping database ..."
kubectl --kubeconfig=${KUBECONFIG} -n default exec -it \ kubectl --kubeconfig=${KUBECONFIG} -n default exec -it \
$(kubectl --kubeconfig=${KUBECONFIG} -n default get pods | grep ocelot-neo4j | awk '{ print $1 }') \ $(kubectl --kubeconfig=${KUBECONFIG} -n default get pods | grep ocelot-neo4j | awk '{ print $1 }') \
-- neo4j-admin dump --database=neo4j --to=/var/lib/neo4j/$BACKUP_DATE-neo4j-dump -- neo4j-admin dump --to=/var/lib/neo4j/$BACKUP_DATE-neo4j-dump
# copy neo4j backup to local drive # copy neo4j backup to local drive
echo "Coping database ..." echo "Coping database ..."
kubectl --kubeconfig=${KUBECONFIG} cp \ kubectl --kubeconfig=${KUBECONFIG} cp \

View File

@ -137,7 +137,7 @@ $ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-neo4j
# bash: enter bash of Neo4j # bash: enter bash of Neo4j
$ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-neo4j | awk '{ print $1 }') -- bash $ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-neo4j | awk '{ print $1 }') -- bash
# generate Dump # generate Dump
neo4j% neo4j-admin dump --database=neo4j --to=/var/lib/neo4j/$(date +%F)-neo4j-dump neo4j% neo4j-admin dump --to=/var/lib/neo4j/$(date +%F)-neo4j-dump
# exit bash # exit bash
neo4j% exit neo4j% exit
@ -145,6 +145,8 @@ neo4j% exit
$ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-neo4j | awk '{ print $1 }') -- ls $ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-neo4j | awk '{ print $1 }') -- ls
``` ```
If you need a specific database name, add the option `--database=<name>` to the command `neo4j-admin dump`.
Lets copy the dump backup Lets copy the dump backup
```bash ```bash

View File

@ -67,7 +67,7 @@ To create a dump in Neo4j running in a Docker container:
# connect to the Docker containers Neo4j terminal # connect to the Docker containers Neo4j terminal
$ docker exec -it neo4j bash $ docker exec -it neo4j bash
# generate Dump # generate Dump
neo4j% neo4j-admin dump --database=neo4j --to=/var/lib/neo4j/$(date +%F)-neo4j-dump neo4j% neo4j-admin dump --to=/var/lib/neo4j/$(date +%F)-neo4j-dump
# exit bash # exit bash
neo4j% exit neo4j% exit
# copy the dump out of the running Docker container # copy the dump out of the running Docker container
@ -89,7 +89,7 @@ $ docker cp <local-folder-path>/neo4j-dump <docker-image-name('neo4j')>:/var/lib
# connect to the Docker containers Neo4j terminal # connect to the Docker containers Neo4j terminal
$ docker exec -it neo4j bash $ docker exec -it neo4j bash
# to load the dump into the database we need the following command in this terminal # to load the dump into the database we need the following command in this terminal
neo4j% neo4j-admin load --expand-commands --database=neo4j --from /var/lib/neo4j/$(date +%F)-neo4j-dump --force neo4j% neo4j-admin load --from /var/lib/neo4j/$(date +%F)-neo4j-dump --force
# leave the terminal by entering # leave the terminal by entering
neo4j% exit neo4j% exit
``` ```