Created
November 9, 2019 12:32
-
-
Save jexp/88208b07830f397b58a2b4cbbb67db1d to your computer and use it in GitHub Desktop.
Truncate Neo4j Aura Cloud Database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -f bin/neo4j-admin ]; then echo "Please change to the Neo4j Installation directory!!"; exit 1; fi | |
echo "Have your password and Neo4j Aura Cloud Database Bolt URL ready!" | |
echo "This will override your cloud database with an empty one!!!" | |
echo "If you don't want that press <ctrl-c>, otherwise <enter>" | |
echo | |
read | |
if [ ! -f plugins/neo4j-push-to-cloud-3.jar ]; then | |
echo "Downloading push-to-cloud jar" | |
curl -sOL https://dist.neo4j.org/neo4j-push-to-cloud-3.jar | |
mv neo4j-push-to-cloud-3.jar plugins | |
fi | |
echo | |
echo "Downloading empty database dump" | |
curl -sL -o empty.dump https://www.dropbox.com/s/z3m8rjhx5ew9zfz/empty.dump?dl=1 | |
echo "Running push-to-cloud" | |
echo -n "Bolt URI: " | |
read bolt | |
echo -n "Password for user neo4j: " | |
read -s password | |
echo "The 'import' stage might hang at 35% but don't worry it will continue." | |
bin/neo4j-admin push-to-cloud --bolt-uri "$bolt" --overwrite=true --dump=empty.dump --username=neo4j --password="$password" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
works by uploading an empty neo4j database dump using the
push-to-cloud
tool.