Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,30 +213,20 @@ PMOVES.AI is a **production-ready multi-agent orchestration platform** featuring
- Services: DB (Postgres 17.6.1), GoTrue, PostgREST v14.3, Kong 3.7.1, Realtime v2.72.0, Storage v1.37.1, Studio, imgproxy, pg-meta, Edge Functions, Analytics (Logflare), Vector, Supavisor
- Canonical consumer URL: `http://supabase-kong:8000/rest/v1` (via Kong gateway)
- Standard variable names: `JWT_SECRET`, `ANON_KEY`, `SERVICE_ROLE_KEY` (SUPABASE_* aliases for compat)
n**Neo4j** [Port 7474 HTTP, 7687 Bolt, 2004 Metrics]

**Neo4j** [Port 7474 HTTP, 7687 Bolt]
- Graph database for knowledge management, CHIT consciousness taxonomy, agent memory
- Profile-based integration: make -C pmoves neo4j-local-up
- API: POST http://localhost:7474/db/neo4j/tx/commit (Cypher transactions)
- Health: GET http://localhost:7474/db/neo4j/health
- **Use for:** Graph queries, relationship traversal, CHIT consciousness taxonomy, agent memory
- **Submodule:** PMOVES-Neo4j (root-level, follows PMOVES-supabase pattern)
- **See:** `PMOVES-Neo4j/CLAUDE.md` for submodule context
- Schema: `pmoves_core`, Archon prompts
- **Use for:** Metadata storage, content records, agent state, auth, connection pooling

**Qdrant** [Port 6333]
- Vector embeddings for semantic search
- Collection: `pmoves_chunks`

**Neo4j** [Port 7474 HTTP, 7687 Bolt, 2004 Metrics]
- Graph database for knowledge management, CHIT consciousness taxonomy, agent memory
- Profile-based integration: make -C pmoves neo4j-local-up
- API: POST http://localhost:7474/db/neo4j/tx/commit (Cypher transactions)
- Health: GET http://localhost:7474/db/neo4j/health
- **Use for:** Graph queries, relationship traversal, CHIT consciousness taxonomy, agent memory
- **Submodule:** PMOVES-Neo4j (root-level, follows PMOVES-supabase pattern)
- **See:** `PMOVES-Neo4j/CLAUDE.md` for submodule context

**Meilisearch** [Port 7700]
- Full-text keyword search
- Typo-tolerant, substring search
Expand Down
114 changes: 29 additions & 85 deletions pmoves/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -640,60 +640,6 @@ supabase-clean: ## Stop + remove Supabase containers and volumes
@$(DC) --profile supabase-local down -v --remove-orphans >/dev/null 2>&1 || true
@echo "โœ… Supabase stack cleaned"

.PHONY: neo4j-up neo4j-down neo4j-restart neo4j-logs neo4j-migrate neo4j-seed neo4j-bootstrap neo4j-status

neo4j-up: ## Start Neo4j submodule stack
@echo "โ†’ Starting Neo4j from submodule..."
@$(MAKE) --no-print-directory -C pmoves/integrations/neo4j up

neo4j-down: ## Stop Neo4j submodule stack
@echo "โ†’ Stopping Neo4j from submodule..."
@$(MAKE) --no-print-directory -C pmoves/integrations/neo4j down

neo4j-restart: ## Restart Neo4j submodule stack
@echo "โ†’ Restarting Neo4j from submodule..."
@$(MAKE) --no-print-directory -C pmoves/integrations/neo4j restart

neo4j-logs: ## View Neo4j logs
@$(MAKE) --no-print-directory -C pmoves/integrations/neo4j logs

neo4j-migrate: ## Run Neo4j migration (usage: make neo4j-migrate VERSION=003)
@if [ -z "$(VERSION)" ]; then \
echo "Usage: make neo4j-migrate VERSION=003"; \
echo ""; \
echo "Available migrations:"; \
ls -1 pmoves/integrations/neo4j/db/migrations/*.cypher 2>/dev/null | while read -r f; do \
echo " โ€ข $$(basename "$f")"; \
done; \
exit 1; \
fi
@$(MAKE) --no-print-directory -C pmoves/integrations/neo4j migrate VERSION=$(VERSION)

neo4j-seed: ## Load Neo4j seed data (usage: make neo4j-seed SEED=001_person_aliases.csv)
@if [ -z "$(SEED)" ]; then \
echo "Usage: make neo4j-seed SEED=001_person_aliases.csv"; \
echo ""; \
echo "Available seeds:"; \
ls -1 pmoves/integrations/neo4j/db/seeds/*.csv 2>/dev/null | while read -r f; do \
echo " โ€ข $$(basename "$f")"; \
done; \
exit 1; \
fi
@$(MAKE) --no-print-directory -C pmoves/integrations/neo4j seed SEED=$(SEED)

neo4j-bootstrap: ## Initialize Neo4j (run migrations and seeds)
@echo "โ†’ Bootstrapping Neo4j from submodule..."
@$(MAKE) --no-print-directory -C pmoves/integrations/neo4j bootstrap

neo4j-status: ## Check Neo4j status from submodule
@$(MAKE) --no-print-directory -C pmoves/integrations/neo4j status

# Legacy compatibility (delegates to submodule)
.PHONY: neo4j-bootstrap-legacy
neo4j-bootstrap-legacy: ## Legacy bootstrap script (deprecated: use neo4j-bootstrap)
@echo "โš ๏ธ This target is deprecated. Use: make neo4j-bootstrap"
@$(MAKE) --no-print-directory neo4j-bootstrap

.PHONY: seed-data
seed-data: ## Seed Qdrant/Meilisearch with demo corpus via Hi-RAG v2
@echo "๐Ÿ“š Seeding Qdrant/Meili demo corpus..."
Expand Down Expand Up @@ -1917,10 +1863,6 @@ neo4j-reset: ## DANGEROUS: wipe Neo4j volume and recreate with current NEO4J_AUT
"/var/lib/neo4j/bin/cypher-shell -u \"$$user\" -p \"$$pass\" \"RETURN 1\""; \
'

neo4j-status: ## Show Neo4j logs and health line
@$(DC) ps neo4j || true
@$(DC) logs --tail 60 neo4j || true

brand-verify: ## Verify key branded endpoints respond
@echo "Presign:" && curl -fsS http://localhost:8088/healthz && echo
@echo "Supabase REST:" && curl -fsS -o /dev/null -w '%{http_code}\n' http://host.docker.internal:65421/rest/v1 || true
Expand Down Expand Up @@ -2820,49 +2762,49 @@ github-app-test: ## Test GitHub App token minting (requires services running)

neo4j-up: ## Start Neo4j submodule stack
@echo "โ†’ Starting Neo4j from submodule..."
@$(MAKE) --no-print-directory -C PMOVES-Neo4j up
@$(MAKE) --no-print-directory -C ../PMOVES-Neo4j up

neo4j-down: ## Stop Neo4j submodule stack
@echo "โ†’ Stopping Neo4j from submodule..."
@$(MAKE) --no-print-directory -C PMOVES-Neo4j down
@$(MAKE) --no-print-directory -C ../PMOVES-Neo4j down

neo4j-restart: ## Restart Neo4j submodule stack
@echo "โ†’ Restarting Neo4j from submodule..."
@$(MAKE) --no-print-directory -C PMOVES-Neo4j restart
@$(MAKE) --no-print-directory -C ../PMOVES-Neo4j restart

neo4j-logs: ## View Neo4j logs
@$(MAKE) --no-print-directory -C PMOVES-Neo4j logs
@$(MAKE) --no-print-directory -C ../PMOVES-Neo4j logs

neo4j-migrate: ## Run Neo4j migration (usage: make neo4j-migrate VERSION=003)
@if [ -z "$(VERSION)" ]; then \
echo "Usage: make neo4j-migrate VERSION=003"; \
echo ""; \
echo "Available migrations:"; \
ls -1 PMOVES-Neo4j/db/migrations/*.cypher 2>/dev/null | while read -r f; do \
ls -1 ../PMOVES-Neo4j/db/migrations/*.cypher 2>/dev/null | while read -r f; do \
echo " โ€ข $$(basename "$$f")"; \
done; \
exit 1; \
fi
@$(MAKE) --no-print-directory -C PMOVES-Neo4j migrate VERSION=$(VERSION)
@$(MAKE) --no-print-directory -C ../PMOVES-Neo4j migrate VERSION=$(VERSION)

neo4j-seed: ## Load Neo4j seed data (usage: make neo4j-seed SEED=001_person_aliases.csv)
@if [ -z "$(SEED)" ]; then \
echo "Usage: make neo4j-seed SEED=001_person_aliases.csv"; \
echo ""; \
echo "Available seeds:"; \
ls -1 PMOVES-Neo4j/db/seeds/*.csv 2>/dev/null | while read -r f; do \
ls -1 ../PMOVES-Neo4j/db/seeds/*.csv 2>/dev/null | while read -r f; do \
echo " โ€ข $$(basename "$$f")"; \
done; \
exit 1; \
fi
@$(MAKE) --no-print-directory -C PMOVES-Neo4j seed SEED=$(SEED)
@$(MAKE) --no-print-directory -C ../PMOVES-Neo4j seed SEED=$(SEED)

neo4j-bootstrap: ## Initialize Neo4j (run migrations and seeds)
@echo "โ†’ Bootstrapping Neo4j from submodule..."
@$(MAKE) --no-print-directory -C PMOVES-Neo4j bootstrap
@$(MAKE) --no-print-directory -C ../PMOVES-Neo4j bootstrap

neo4j-status: ## Check Neo4j status from submodule
@$(MAKE) --no-print-directory -C PMOVES-Neo4j status
@$(MAKE) --no-print-directory -C ../PMOVES-Neo4j status

# Legacy compatibility
.PHONY: neo4j-bootstrap-legacy
Expand All @@ -2881,7 +2823,8 @@ neo4j-local-up: ## Start Neo4j with profile (make neo4j-local-up)

neo4j-local-down: ## Stop Neo4j with profile (make neo4j-local-down)
@echo "โ†’ Stopping Neo4j with neo4j-local profile..."
@$(DC) --profile neo4j-local down -v --remove-orphans
@$(DC) --profile neo4j-local stop neo4j >/dev/null 2>&1 || true
@$(DC) --profile neo4j-local rm -f neo4j >/dev/null 2>&1 || true
@echo "โœ… Neo4j stopped"
Comment thread
coderabbitai[bot] marked this conversation as resolved.

neo4j-local-status: ## Check Neo4j status (make neo4j-local-status)
Expand All @@ -2890,10 +2833,10 @@ neo4j-local-status: ## Check Neo4j status (make neo4j-local-status)

.PHONY: neo4j-backup neo4j-restore

neo4j-backup: ## Backup Neo4j database to pmoves/backups/ with timestamp
neo4j-backup: ## Backup Neo4j database to backups/ with timestamp
@echo "โ†’ Creating Neo4j backup..."
@timestamp=$$(date +%Y%m%d_%H%M%S); \
backup_dir="pmoves/backups"; \
backup_dir="backups"; \
mkdir -p "$$backup_dir"; \
container_name=$$($(DC) ps -q neo4j 2>/dev/null | head -1); \
if [ -z "$$container_name" ]; then \
Expand All @@ -2903,35 +2846,36 @@ neo4j-backup: ## Backup Neo4j database to pmoves/backups/ with timestamp
container_name=$$($(DC) ps -q neo4j 2>/dev/null | head -1); \
fi; \
if [ -n "$$container_name" ]; then \
docker exec $$container_name neo4j-admin database dump \
if docker exec $$container_name neo4j-admin database dump \
--to-path=/backups \
--overwrite-destination=true \
--username=neo4j \
--password="$${NEO4J_PASSWORD:-changeme}" 2>/dev/null || \
docker exec $$container_name cypher-shell -u neo4j -p "$${NEO4J_PASSWORD:-changeme}" \
"CALL apoc.export.cypher.all(null, 'file:///backups/neo4j_$${timestamp}.cypher', {})"; \
docker cp $$container_name:/backups/neo4j.dump "$$backup_dir/neo4j_$${timestamp}.dump" 2>/dev/null || \
echo "โš ๏ธ Backup file not found at /backups/neo4j.dump"; \
if [ -f "$$backup_dir/neo4j_$${timestamp}.dump" ]; then \
echo "โœ… Backup created: $$backup_dir/neo4j_$${timestamp}.dump"; \
ls -lh "$$backup_dir/neo4j_$${timestamp}.dump"; \
--password="$${NEO4J_PASSWORD:-changeme}" 2>/dev/null; then \
docker cp $$container_name:/backups/neo4j.dump "$$backup_dir/neo4j_$${timestamp}.dump" 2>/dev/null && \
echo "โœ… Backup created: $$backup_dir/neo4j_$${timestamp}.dump" && \
ls -lh "$$backup_dir/neo4j_$${timestamp}.dump"; \
elif docker exec $$container_name cypher-shell -u neo4j -p "$${NEO4J_PASSWORD:-changeme}" \
"CALL apoc.export.cypher.all(null, 'file:///backups/neo4j_$${timestamp}.cypher', {})"; then \
docker cp $$container_name:/backups/neo4j_$${timestamp}.cypher "$$backup_dir/neo4j_$${timestamp}.cypher" 2>/dev/null && \
Comment on lines +2849 to +2859

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

โš ๏ธ Potential issue | ๐Ÿ”ด Critical

๐Ÿงฉ Analysis chain

๐Ÿ Script executed:

# First, let's look at the Makefile at the specified lines
head -2787 pmoves/Makefile | tail -20

Repository: POWERFULMOVES/PMOVES.AI

Length of output: 1187


๐Ÿ Script executed:

# Also check the second location mentioned (2824-2829)
head -2829 pmoves/Makefile | tail -10

Repository: POWERFULMOVES/PMOVES.AI

Length of output: 484


๐ŸŒ Web query:

Neo4j neo4j-admin database dump command syntax arguments username password

๐Ÿ’ก Result:

neo4j-admin database dump is an offline, local admin command and does not accept username/password arguments.

Syntax (Neo4j Ops Manual):

neo4j-admin database dump [-h] [--expand-commands] [--verbose]
  [--overwrite-destination[=true|false]]
  [--additional-config=<file>]
  [--to-path=<path> | --to-stdout]
  <database>

[1]

Example:

neo4j-admin database dump neo4j --to-path=/var/backups/neo4j --overwrite-destination=true

[1]

If you need an authenticated, online-safe backup, thatโ€™s a different command flow (e.g., neo4j-admin database backup for online backups in Enterprise), not database dump. [2]

Sources: Neo4j Operations Manual (offline dump syntax/options) [1], Neo4j neo4j-admin command reference (dump vs backup) [2].


๐ŸŒ Web query:

Neo4j neo4j-admin database load --from-path authentication

๐Ÿ’ก Result:

neo4j-admin database load --from-path=โ€ฆ does not authenticate to Neo4j with a username/password. Itโ€™s a local admin command that loads store files from an on-disk (or cloud-bucket) archive; it must be run with OS-level permissions (Neo4j recommends running it as the neo4j OS user) and you must stop the target database if youโ€™re overwriting it. [1]

What can require โ€œauthenticationโ€:

  • Cloud storage access (S3/GCS/Azure): --from-path can point to bucket URIs, and then you must provide cloud credentials (AWS/GCP/Azure), not Neo4j credentials. [1]
  • Neo4j login after restore: if you restored the system database (where native users/roles live in modern Neo4j), your instanceโ€™s users/passwords may change accordingly; if youโ€™re locked out, follow Neo4jโ€™s password recovery flow (temporarily disable auth and reset the password in system). [2]

Sources:
[1] Neo4j Operations Manual โ€“ โ€œRestore a database dumpโ€ (neo4j-admin database load, --from-path, overwrite, cloud paths, run as neo4j user)
[2] Neo4j Operations Manual โ€“ โ€œRecover admin user and passwordโ€ (disable auth + reset via system)


Fix neo4j-admin backup/restore syntax โ€“ missing database argument and invalid authentication flags.

The neo4j-admin database dump and neo4j-admin database load commands are offline, local admin commands that do not accept --username or --password arguments. Additionally:

  • database dump requires a positional <database> argument (e.g., neo4j) and is missing it.
  • database load uses --from= instead of the correct --from-path= parameter.
Current code
# Lines ~2777-2787 (backup)
docker exec $$container_name neo4j-admin database dump \
    --to-path=/backups \
    --overwrite-destination=true \
    --username=neo4j \
    --password="$${NEO4J_PASSWORD:-changeme}"

# Lines ~2824-2829 (restore)
docker exec $$container_name neo4j-admin database load \
    --from=/backups/neo4j.dump \
    --overwrite-destination=true \
    --username=neo4j \
    --password="$${NEO4J_PASSWORD:-changeme}"

These commands will fail immediately with syntax errors. Correct syntax requires removing the auth flags and adding the database name to dump, and using --from-path= for load.

๐Ÿค– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pmoves/Makefile` around lines 2777 - 2787, The neo4j dump/load commands are
using invalid auth flags and missing/incorrect parameters: update the docker
exec invocations that call neo4j-admin (references: neo4j-admin database dump
and neo4j-admin database load, variables $$container_name, $$backup_dir,
$$timestamp) to remove --username/--password (neo4j-admin is an offline local
admin), add the required positional database name (e.g., "neo4j") to the
database dump command, and change the load flag from --from= to --from-path= so
the load uses --from-path=/backups/neo4j_$${timestamp}.dump (or .cypher as
appropriate); keep the surrounding docker cp and echo/ls behavior unchanged.

echo "โœ… Backup created: $$backup_dir/neo4j_$${timestamp}.cypher" && \
ls -lh "$$backup_dir/neo4j_$${timestamp}.cypher"; \
else \
echo "โŒ Backup failed - no file created"; \
echo "โŒ Backup failed - neither dump nor cypher export succeeded"; \
exit 1; \
fi; \
else \
echo "โŒ Neo4j container not available"; \
exit 1; \
fi

neo4j-restore: ## Restore Neo4j from backup (usage: make neo4j-restore BACKUP=pmoves/backups/neo4j_YYYYMMDD_HHMMSS.dump)
neo4j-restore: ## Restore Neo4j from backup (usage: make neo4j-restore BACKUP=backups/neo4j_YYYYMMDD_HHMMSS.dump)
@if [ -z "$(BACKUP)" ]; then \
echo "โŒ Error: BACKUP parameter required"; \
echo ""; \
echo "Usage: make neo4j-restore BACKUP=pmoves/backups/neo4j_20260313_120000.dump"; \
echo "Usage: make neo4j-restore BACKUP=backups/neo4j_20260313_120000.dump"; \
echo ""; \
echo "Available backups:"; \
ls -lh pmoves/backups/neo4j_*.dump 2>/dev/null || echo " No backups found in pmoves/backups/"; \
ls -lh backups/neo4j_*.dump 2>/dev/null || echo " No backups found in backups/"; \
exit 1; \
fi
@if [ ! -f "$(BACKUP)" ]; then \
Expand All @@ -2943,7 +2887,7 @@ neo4j-restore: ## Restore Neo4j from backup (usage: make neo4j-restore BACKUP=pm
@echo "Press Ctrl+C to cancel, or wait 5 seconds to continue..."
@sleep 5
@$(MAKE) --no-print-directory neo4j-local-down
@docker volume rm pmoves_neo4jdata 2>/dev/null || true
@docker volume rm pmoves_neo4j-data 2>/dev/null || true
@echo "โ†’ Starting fresh Neo4j..."
Comment thread
coderabbitai[bot] marked this conversation as resolved.
@$(MAKE) --no-print-directory neo4j-local-up
@sleep 15
Expand Down
4 changes: 2 additions & 2 deletions pmoves/docs/NEO4J_INTEGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ PMOVES-Neo4j/ at root level (follows PMOVES-supabase pattern)
make -C pmoves neo4j-backup

# Restore
make -C pmoves neo4j-restore BACKUP=pmoves/backups/neo4j_YYYYMMDD_HHMMSS.dump
make -C pmoves neo4j-restore BACKUP=backups/neo4j_YYYYMMDD_HHMMSS.dump
```

## Monitoring
Expand All @@ -68,7 +68,7 @@ curl http://localhost:7474/db/neo4j/health
```

### Grafana Dashboard
- URL: http://localhost:3000
- URL: http://localhost:3002
- Dashboard: Neo4j Overview
- Panels: Database size, heap usage, transaction rate, cache performance
Comment thread
coderabbitai[bot] marked this conversation as resolved.

Expand Down
6 changes: 6 additions & 0 deletions pmoves/monitoring/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ scrape_configs:
static_configs:
- targets: ["supaserch:8099"]

- job_name: neo4j
static_configs:
- targets: ["neo4j:2004"]
metrics_path: '/metrics'
scrape_interval: 15s

- job_name: gpu-orchestrator
static_configs:
- targets: ["gpu-orchestrator:8200"]
Expand Down
28 changes: 21 additions & 7 deletions pmoves/scripts/backup-neo4j.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Neo4j Database Backup Script
# =============================================================================
# Automated backup script for Neo4j graph database.
# Creates timestamped dumps to pmoves/backups/ with rotation.
# Creates timestamped dumps to backups/ with rotation.
#
# Usage: ./pmoves/scripts/backup-neo4j.sh [retention_days]
# Default retention: 7 days
Expand All @@ -13,12 +13,22 @@

set -euo pipefail

# Script directory (for loading env.shared)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"

# Load credentials if env.shared exists
if [ -f "$PROJECT_ROOT/env.shared" ]; then
source "$PROJECT_ROOT/env.shared"
fi

# Configuration
BACKUP_DIR="pmoves/backups"
BACKUP_DIR="backups"
CONTAINER_NAME="pmoves-neo4j-1"
RETENTION_DAYS=${1:-7}
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
BACKUP_FILE="neo4j_${TIMESTAMP}.dump"
CONTAINER_BACKUP_DIR="/data/backups"

# Colors for output
RED='\033[0;31m'
Expand Down Expand Up @@ -55,21 +65,25 @@ if ! docker ps --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then
exit 1
fi

# Get Neo4j password from environment
# Get Neo4j password from environment (with fallback)
NEO4J_PASSWORD=${NEO4J_PASSWORD:-changeme}

# Create backup directory inside container
log_info "Creating backup directory inside container..."
docker exec "$CONTAINER_NAME" mkdir -p "$CONTAINER_BACKUP_DIR"

# Create backup using neo4j-admin
log_info "Creating Neo4j backup: ${BACKUP_FILE}"

if docker exec "$CONTAINER_NAME" neo4j-admin database dump \
--to-path=/backups \
--to-path="$CONTAINER_BACKUP_DIR" \
--overwrite-destination=true \
--username=neo4j \
--password="$NEO4J_PASSWORD" 2>/dev/null; then
Comment on lines +78 to +82

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

โš ๏ธ Potential issue | ๐Ÿ”ด Critical

๐Ÿงฉ Analysis chain

๐Ÿ Script executed:

# First, check if the file exists and read the full script context
find . -name "backup-neo4j.sh" -type f

Repository: POWERFULMOVES/PMOVES.AI

Length of output: 99


๐Ÿ Script executed:

# Also check the Neo4j version or any version pinning in the codebase
fd -e "Dockerfile\|docker-compose\|env\|requirements" | head -20

Repository: POWERFULMOVES/PMOVES.AI

Length of output: 49


๐Ÿ Script executed:

# Search for neo4j references in the codebase
rg "neo4j" --type sh -A 2 -B 2

Repository: POWERFULMOVES/PMOVES.AI

Length of output: 12758


๐Ÿ Script executed:

cat -n pmoves/scripts/backup-neo4j.sh

Repository: POWERFULMOVES/PMOVES.AI

Length of output: 4063


๐ŸŒ Web query:

neo4j-admin database dump command syntax flags username password

๐Ÿ’ก Result:

neo4j-admin database dump (Neo4j 5.x+) syntax & flags

Syntax (offline database dump):

neo4j-admin database dump [-h] [--expand-commands] [--verbose]
  [--overwrite-destination[=true|false]]
  [--additional-config=<file>]
  [--to-path=<path> | --to-stdout]
  <database>

[1]

Key flags

  • --to-path=<path>: destination directory for the dump file (or a supported cloud-storage URI). [1]
  • --to-stdout: stream the dump to stdout (for piping). [1]
  • --overwrite-destination[=true|false]: overwrite an existing dump file in the destination (default false). [1]
  • --additional-config=<file>: supply extra config overrides. [1]
  • --expand-commands: allow command expansion in config value evaluation. [1]
  • --verbose, -h/--help. [1]

Username/password?

  • neo4j-admin database dump does not take Neo4j auth flags (no --username/--password, no -u/-p) because it operates on the local store files (the database must not be mounted/running). [1]

Example

bin/neo4j-admin database dump neo4j --to-path=/full/path/to/dumps

[1]

Notes

  • Dumps contain database data only; users/roles (RBAC) metadata is not included. [2]

Sources: Neo4j Operations Manual (offline backup / dump command reference) [1] and backup-restore overview notes on dump contents [2].


๐ŸŒ Web query:

neo4j-admin database dump running server offline requirements

๐Ÿ’ก Result:

neo4j-admin database dump is an offline dump: the target database must be offline (not mounted), so you cannot dump a database thatโ€™s mounted in a running Neo4j server. [1]

What โ€œofflineโ€ means / requirements

  • Database must be stopped/unmounted before running the dump. [1]
  • Local-only operation:
    • Enterprise: can run the command from an online or offline DBMS, but the database youโ€™re dumping must be stopped; if youโ€™re in a cluster, the database must be stopped on the specific server you run it on. [1]
    • Community: can run the command only when the DBMS is offline (i.e., stop the Neo4j service). [1]
  • File/dir permissions: ensure the dump target directory exists and has safe permissions (Neo4j warns the target directory must not be world-readable/executable). [1]
  • Common operational pattern (incl. Kubernetes): put Neo4j into offline maintenance mode, run dump(s), then bring it back online. [2]

If you need a backup while the server stays running

  • Use neo4j-admin database backup (Enterprise) for online backups from a running server (requires the backup service to be configured). [3]

Sources

  1. Neo4j Operations Manual โ€“ Back up an offline database https://neo4j.com/docs/operations-manual/current/backup-restore/offline-backup/
  2. Neo4j Operations Manual (Kubernetes) โ€“ Dump and load databases (offline) https://neo4j.com/docs/operations-manual/current/kubernetes/operations/dump-load/
  3. Neo4j Operations Manual โ€“ Back up an online database https://neo4j.com/docs/operations-manual/current/backup-restore/online-backup/

๐ŸŒ Web query:

neo4j-admin database dump database argument required

๐Ÿ’ก Result:

That error means you didnโ€™t provide the required positional <database> argument.

In Neo4j 5+ / current docs, the syntax is:
neo4j-admin database dump ... <database> (database name is not given via --database) [1].

Examples:

# Dump the default database
bin/neo4j-admin database dump neo4j --to-path=/full/path/to/dumps
# Or stream to stdout
bin/neo4j-admin database dump neo4j --to-stdout > neo4j.dump

If youโ€™re following older Neo4j 3.x/4.x instructions, the legacy form was:

neo4j-admin dump --database=MyDatabase --to=backup.dump

[2]

Sources: [1] [2]


This neo4j-admin database dump invocation is invalid.

neo4j-admin database dump requires a positional <database> argument (e.g., neo4j), does not accept --username/--password flags, and cannot run against a database mounted in a running server. The database must be offline. Either stop the Neo4j service before dumping, or use neo4j-admin database backup for online backups (Enterprise only). (neo4j.com/docs/operations-manual/current/backup-restore/offline-backup/)

๐Ÿค– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pmoves/scripts/backup-neo4j.sh` around lines 78 - 82, The neo4j-admin
invocation in the backup script is invalid: `neo4j-admin database dump` requires
a positional <database> name, does not accept `--username/--password`, and must
operate on an offline DB; it cannot dump a running server via docker exec. Fix
pmoves/scripts/backup-neo4j.sh by either (A) shutting down the Neo4j container
(use CONTAINER_NAME to stop the container or stop the service inside it), then
run `neo4j-admin database dump <database>` writing to CONTAINER_BACKUP_DIR
(remove --username/--password), or (B) if you have Enterprise and need an online
backup, replace the command with `neo4j-admin database backup ...` (use
Enterprise backup flags) and adjust logic accordingly; ensure you reference
CONTAINER_NAME, CONTAINER_BACKUP_DIR, and the correct database name when
updating the script.


# Copy backup from container
docker cp "$CONTAINER_NAME:/backups/neo4j.dump" "$BACKUP_DIR/$BACKUP_FILE"
docker cp "$CONTAINER_NAME:$CONTAINER_BACKUP_DIR/neo4j.dump" "$BACKUP_DIR/$BACKUP_FILE"

# Verify backup file exists and is not empty
if [ -f "$BACKUP_DIR/$BACKUP_FILE" ] && [ -s "$BACKUP_DIR/$BACKUP_FILE" ]; then
BACKUP_SIZE=$(du -h "$BACKUP_DIR/$BACKUP_FILE" | cut -f1)
Expand Down
Loading