Hello everyone,
I am having a hard time restoring a single database on a Neo4j standalone 4.4.17 enterprise instance, running in a AKS k8s cluster. Unfortunately I am not allowed by policies to exec into the Pod running the Neo4j itself, but I am in full control over all k8s resources I have created. So my workflow until now was to create k8s Jobs which fulfil all tasks I needed. My question:
Is there a way to restore an online database over network/remotely? I have been able to create backups from a k8s Job I have created, but I am not able to restore backups remotely. Got my own backup scripts in a custom image by now like this:
create_backup_neo4j() {
# https://neo4j.com/docs/operations-manual/4.4/backup-restore/prepare-restore/
echo "+++ START: CREATING NEO4j BACKUP +++"
mkdir -p ${BACKUP_PATH}
neo4j-admin backup \
--backup-dir=${BACKUP_PATH} \
--verbose \
--from="${NEO4J_ADMIN_SERVICE_HOST}:${NEO4J_ADMIN_SERVICE_PORT}" \
--database="${NEO4J_DB_TO_BACKUP}" \
--check-consistency=true \
--check-graph=true \
--check-indexes=true \
--check-index-structure=true \
--include-metadata="all" \
--prepare-restore=true \
--parallel-recovery=false
echo "+++ END: CREATING NEO4J BACKUP +++"
}
Restore:
restore_neo4j_backup_azure() {
stop_database
echo "+++ START: IMPORT NEO4J BACKUP FROM AZURE +++"
chown neo4j: -R /restore/backup/
neo4j-admin restore \
--from="${RESTORE_PATH}/${NEO4J_RESTORE_PATTERN%?}" \
--database="$(echo "${NEO4J_RESTORE_PATTERN}" | cut -f3 -d'/')" \
--verbose \
--force
restore_neo4j_metadata
start_database
echo "+++ END: IMPORT NEO4J BACKUP FROM AZURE +++"
}
I assume my restore fails silently since my restore Pod is separated from Neo4J Pod and the neo4j-admin restore Binary expects to run Neo4J on local machine, right? So question is, can I restore a remote Neo4J instance over network without being logged in into the Neo4J instance itself?
Cheers,
Szop