Skip to content

Instantly share code, notes, and snippets.

@booleangate
Last active April 16, 2025 23:28
Show Gist options
  • Save booleangate/ba24072715525d4214c6dcd1f0b765e2 to your computer and use it in GitHub Desktop.
Save booleangate/ba24072715525d4214c6dcd1f0b765e2 to your computer and use it in GitHub Desktop.
Migrate your local database to mongo.
#!/usr/bin/env bash
set -e
git checkout main
git pull
mongodump --db=pblocal
brew services stop $(brew services list | grep mongodb-community | cut -f1 -d' ')
# Docker setup requires this file for some reason (see thread)
ls apps/eris/.env.local &> /dev/null || cp apps/eris/.env.sample apps/eris/.env.local
docker compose down mongo
docker compose up mongo --wait
mongorestore ./dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment