Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Replit database import/export
# Export to a folder
mkdir -p db
cd db
curl -k $REPLIT_DB_URL?prefix= | xargs -I@ curl -k -O "$REPLIT_DB_URL/@"
cd ..
tar -czvf db.tar.gz db
# Then download db.tar.gz manually
# -------------------------------------------------------------------------------------
# Import back to a repl
# Upload the db.tar.gz file
tar -xzvf db.tar.gz
cd db
find . -type f -printf '%f\n' | xargs -I@ sh -c 'curl $REPLIT_DB_URL --data-urlencode "@=$(cat "@")"'
cd ..
rm -rf db db.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment