Skip to content

Instantly share code, notes, and snippets.

@jexp
Created November 9, 2019 12:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jexp/88208b07830f397b58a2b4cbbb67db1d to your computer and use it in GitHub Desktop.
Save jexp/88208b07830f397b58a2b4cbbb67db1d to your computer and use it in GitHub Desktop.
Truncate Neo4j Aura Cloud Database
#!/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"
@jexp
Copy link
Author

jexp commented Nov 9, 2019

works by uploading an empty neo4j database dump using the push-to-cloud tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment