Last active
June 6, 2023 02:23
-
-
Save louy/ee78e9f06954455f1467ec8281f2a1ca to your computer and use it in GitHub Desktop.
Replit database import/export
This file contains 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
# 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