7 ms·
>You can't copy the file of a running, active db receiving updates, that can only result in corruption There is a slight 'well akshully' on this. A DB flush an
by pixl97 2y ago
>You can't copy the file of a running, active db receiving updates, that can only result in corruption
There is a slight 'well akshully' on this. A DB flush and FS snapshot where you copy the snapshotted file will allow this. MSSQL VSS snapshots would be an example of this.
- tpmoney 2y agoSimilarly you can rsync a Postgres data directory safely while the db is running, with the caveat that you likely lose any data written while the rsync is running. And if you want that data, you can get it with the WAL files. It’s been years since I needed to do this, but if I remember right, you can clone an entire pg db live with a `pg_backup_start()`, rsync the data directory, pg_backup_stop() and rsync the WAL files written since backup start.
- edoceo 2y agoFor moving DBs where I'm allowed minutes of downtime I do rsync (slow) first from the live, while hot, then just stop that one, then rsync again (fast) then make the new one hot. Works a treat when other (better) method are not available.
- bob1029 2y agoMSSQL also offers a virtual backup device interface that 3rd party tools can implement. https://learn.microsoft.com/en-us/sql/relational-databases/backup-restore/vdi-reference/reference-virtual-device-interface https://learn.microsoft.com/en-us/sql/relational-databases/b...