Skip to content

Instantly share code, notes, and snippets.

@louy
Last active June 6, 2023 02:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save louy/ee78e9f06954455f1467ec8281f2a1ca to your computer and use it in GitHub Desktop.
Save louy/ee78e9f06954455f1467ec8281f2a1ca to your computer and use it in GitHub Desktop.
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