How to Sync Database from Server
Quick Start
Mac / Windows (WSL2 or Git Bash)
Run this single command from the project root:
./scripts/update-local-db-from-server.sh
That's it! Your local database now matches production.
The script uses hardcoded defaults for
nvidia-admin@103.215.13.55. To override, set environment variables before running.
First Time Setup
- Make sure Docker Desktop is running
- Copy the docker override file:
cp docker-compose.override.local.example docker-compose.override.yml - Test SSH access:
ssh nvidia-admin@103.215.13.55
What Each Script Does
update-local-db-from-server.sh- Full sync (download + restore). Use this one.fetch-prod-db.sh- Only downloads backup to./backups/restore-postgres-local.sh- Only restores a backup file to local database
Troubleshooting
"Permission denied" error?
- Make sure you can SSH:
ssh nvidia-admin@103.215.13.55
"docker: command not found"?
- Start Docker Desktop
Windows users:
- Use WSL2, Git Bash, or PowerShell with WSL installed
- Run from the project root folder
Pro Tip: Create an Alias
Add to ~/.zshrc (Mac) or ~/.bashrc (Windows/Linux):
alias sync-db='./scripts/update-local-db-from-server.sh'
Then from anywhere in the project, just type: sync-db