1+ @ echo off
2+ REM ===============================================
3+ REM Neo4j Export Tool - Windows Batch Script
4+ REM ===============================================
5+ REM This script sets up the environment and runs the Neo4j export tool
6+ REM Modify the values below according to your environment
7+
8+ REM ===============================================
9+ REM Neo4j Connection Settings
10+ REM ===============================================
11+
12+ REM Neo4j connection URI (common Windows patterns)
13+ REM For local Neo4j: bolt://localhost:7687
14+ REM For remote Neo4j: bolt://your-server.domain.com:7687
15+ REM For Neo4j Aura: neo4j+s://xxxxxxxx.databases.neo4j.io
16+ set NEO4J_URI = bolt://localhost:7687
17+
18+ REM Neo4j credentials
19+ set NEO4J_USER = neo4j
20+ set NEO4J_PASSWORD = your-password-here
21+
22+ REM ===============================================
23+ REM Output Configuration
24+ REM ===============================================
25+
26+ REM Output directory - common Windows paths
27+ REM Examples:
28+ REM C:\neo4j-exports
29+ REM C:\Users\%USERNAME%\Documents\neo4j-exports
30+ REM D:\data\exports
31+ REM \\network-share\exports
32+ set OUTPUT_DIRECTORY = C:\neo4j-exports
33+
34+ REM Create output directory if it doesn't exist
35+ if not exist " %OUTPUT_DIRECTORY% " (
36+ echo Creating output directory: %OUTPUT_DIRECTORY%
37+ mkdir " %OUTPUT_DIRECTORY% "
38+ )
39+
40+ REM ===============================================
41+ REM Resource Management (Optional)
42+ REM ===============================================
43+
44+ REM Minimum free disk space in GB (default: 10)
45+ set MIN_DISK_GB = 10
46+
47+ REM Maximum memory usage in MB (default: 1024)
48+ set MAX_MEMORY_MB = 1024
49+
50+ REM ===============================================
51+ REM Export Behavior (Optional)
52+ REM ===============================================
53+
54+ REM Skip schema collection for faster exports (true/false)
55+ set SKIP_SCHEMA_COLLECTION = false
56+
57+ REM Batch size for processing (default: 10000)
58+ set BATCH_SIZE = 10000
59+
60+ REM ===============================================
61+ REM Error Handling and Resilience (Optional)
62+ REM ===============================================
63+
64+ REM Maximum retry attempts (default: 5)
65+ set MAX_RETRIES = 5
66+
67+ REM Initial retry delay in milliseconds (default: 1000)
68+ set RETRY_DELAY_MS = 1000
69+
70+ REM Query timeout in seconds (default: 300)
71+ set QUERY_TIMEOUT_SECONDS = 300
72+
73+ REM ===============================================
74+ REM Debugging (Optional)
75+ REM ===============================================
76+
77+ REM Enable debug logging (true/false)
78+ set DEBUG = false
79+
80+ REM Validate JSON output (true/false)
81+ set VALIDATE_JSON = true
82+
83+ REM ===============================================
84+ REM Security Settings (Optional)
85+ REM ===============================================
86+
87+ REM Allow insecure TLS connections (true/false)
88+ REM WARNING: Only set to true for self-signed certificates in dev/test
89+ set ALLOW_INSECURE = false
90+
91+ REM ===============================================
92+ REM Display Configuration
93+ REM ===============================================
94+
95+ echo .
96+ echo Neo4j Export Tool Configuration:
97+ echo ================================
98+ echo Neo4j URI: %NEO4J_URI%
99+ echo Neo4j User: %NEO4J_USER%
100+ echo Output Directory: %OUTPUT_DIRECTORY%
101+ echo Debug Mode: %DEBUG%
102+ echo .
103+
104+ REM ===============================================
105+ REM Run the Export Tool
106+ REM ===============================================
107+
108+ echo Starting Neo4j export...
109+ echo .
110+
111+ REM For Windows x64 (AMD64) - Most common
112+ neo4j-export-windows-amd64.exe
113+
114+ REM For Windows ARM64 (uncomment if using ARM64 Windows)
115+ REM neo4j-export-windows-arm64.exe
116+
117+ REM ===============================================
118+ REM Check Exit Code
119+ REM ===============================================
120+
121+ if %ERRORLEVEL% EQU 0 (
122+ echo .
123+ echo Export completed successfully!
124+ echo Check the output directory: %OUTPUT_DIRECTORY%
125+ ) else (
126+ echo .
127+ echo Export failed with error code: %ERRORLEVEL%
128+ echo .
129+ echo Common error codes:
130+ echo 1 = Configuration error
131+ echo 2 = Connection error
132+ echo 3 = Export error
133+ echo 4 = File system error
134+ echo 5 = Cancellation requested
135+ echo 99 = Unknown error
136+ )
137+
138+ REM ===============================================
139+ REM Optional: Open output directory in Explorer
140+ REM ===============================================
141+
142+ REM Uncomment the line below to automatically open the export directory
143+ REM explorer "%OUTPUT_DIRECTORY%"
144+
145+ REM ===============================================
146+ REM Keep window open to see results
147+ REM ===============================================
148+
149+ echo .
150+ pause
0 commit comments