5
wxcazee
7y

How do you quickly sync your local dev database with production database?

Comments
  • 3
    Can you spare some time as to why you want to do that?
  • 4
    Every change to the dev db is saved as a numbered sql script as a part of a patch set. There is a table that says what patch sets have run. then when the app is upgraded on prod any patches are applied by code that runs the needed sql scripts
  • 9
    Pull out the HDD, run to the server room and attach it to the server! Works every time.
  • 2
    Restore from backup?

    ...Define quickly.
  • 0
    I wrote a few shell scripts to capture, download, import, and archive a backup. Works well for me.
  • 0
    Why and which db 🤔
  • 1
    @jAsE syncing dev db with prod is not very wise if your dev db has some buggy data. So maybe that's why @github was curious of the reason behind this.

    Especially when he said local dev.
  • 0
    The solution you're looking for is Flyway DB - regardless of how stupid the idea might be 😂
  • 1
    Why don't you just go take a dump?

    I'm sorry I couldn't resist
  • 1
    @SupressWarnings it is ok, you have supressed enough
  • 1
    @jAsE @CurseMeSlowly
    What to Sync is unclear for me.
    sizeof(Production DB) >> sizeof(Local Dev DB)

    If he only meant to sync such that to update a subset of rows(or collections) in the local, then it's ok.

    Otherwise, sync up entire Prod DB in local may be interesting.

    Correct me if I interpreted it wrongly.
Add Comment