Files
Alberto-Audrix 32a36cceff
CI / lint-and-test (push) Canceled after 0s
first commit
2026-07-28 08:55:05 +07:00
..
2026-07-28 08:55:05 +07:00
2026-07-28 08:55:05 +07:00
2026-07-28 08:55:05 +07:00
2026-07-28 08:55:05 +07:00
2026-07-28 08:55:05 +07:00

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

  1. Make sure Docker Desktop is running
  2. Copy the docker override file:
    cp docker-compose.override.local.example docker-compose.override.yml
    
  3. 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