mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Change database name from 'graph.db' to 'neo4j'
This commit is contained in:
parent
aeb1432630
commit
b95b036265
@ -29,7 +29,7 @@ ${SCRIPT_DIR}/cluster.neo4j.sh maintenance on
|
||||
# database backup
|
||||
kubectl --kubeconfig=${KUBECONFIG} -n default exec -it \
|
||||
$(kubectl --kubeconfig=${KUBECONFIG} -n default get pods | grep ocelot-neo4j | awk '{ print $1 }') \
|
||||
-- neo4j-admin dump --database=graph.db --to=/var/lib/neo4j/$BACKUP_DATE-neo4j-dump
|
||||
-- neo4j-admin dump --database=neo4j --to=/var/lib/neo4j/$BACKUP_DATE-neo4j-dump
|
||||
# copy neo4j backup to local drive
|
||||
kubectl --kubeconfig=${KUBECONFIG} cp \
|
||||
default/$(kubectl --kubeconfig=${KUBECONFIG} -n default get pods | grep ocelot-neo4j |awk '{ print $1 }'):/var/lib/neo4j/$BACKUP_DATE-neo4j-dump $BACKUP_FOLDER/neo4j-dump
|
||||
|
||||
@ -137,7 +137,7 @@ $ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-neo4j
|
||||
# bash: enter bash of Neo4j
|
||||
$ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-neo4j | awk '{ print $1 }') -- bash
|
||||
# generate Dump
|
||||
neo4j% neo4j-admin dump --database=graph.db --to=/var/lib/neo4j/$(date +%F)-neo4j-dump
|
||||
neo4j% neo4j-admin dump --database=neo4j --to=/var/lib/neo4j/$(date +%F)-neo4j-dump
|
||||
# exit bash
|
||||
neo4j% exit
|
||||
|
||||
|
||||
@ -79,8 +79,8 @@ $ kubectl -n ocelot-social get pods
|
||||
$ kubectl cp ./neo4j-backup human-connection/<POD-ID>:/root/
|
||||
$ kubectl -n ocelot-social exec -it <POD-ID> bash
|
||||
# Once you're in the pod restore the backup and overwrite the default database
|
||||
# called `graph.db` with `--force`.
|
||||
# This will delete all existing data in database `graph.db`!
|
||||
# called `neo4j` with `--force`.
|
||||
# This will delete all existing data in database `neo4j`!
|
||||
> neo4j-admin load --from=/root/neo4j-backup --force
|
||||
> exit
|
||||
```
|
||||
|
||||
@ -68,7 +68,7 @@ To create a dump in Neo4j running in a Docker container:
|
||||
# connect to the Docker containers Neo4j terminal
|
||||
$ docker exec -it neo4j bash
|
||||
# generate Dump
|
||||
neo4j% neo4j-admin dump --database=graph.db --to=/var/lib/neo4j/$(date +%F)-neo4j-dump
|
||||
neo4j% neo4j-admin dump --database=neo4j --to=/var/lib/neo4j/$(date +%F)-neo4j-dump
|
||||
# exit bash
|
||||
neo4j% exit
|
||||
# copy the dump out of the running Docker container
|
||||
@ -88,7 +88,7 @@ $ docker cp <local-folder-path>/neo4j-dump <docker-image-name('neo4j')>:/var/lib
|
||||
# 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% neo4j-admin load --expand-commands --database=graph.db --from /var/lib/neo4j/$(date +%F)-neo4j-dump --force
|
||||
neo4j% neo4j-admin load --expand-commands --database=neo4j --from /var/lib/neo4j/$(date +%F)-neo4j-dump --force
|
||||
# leave the terminal by entering
|
||||
neo4j% exit
|
||||
```
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user