Skip to content

Instantly share code, notes, and snippets.

@louy
Last active June 6, 2023 02:23
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
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