Jump to content


Why is it bad to backup db files?

backup

  • Please log in to reply
3 replies to this topic

#1 davidair

davidair

    Member

  • Members
  • PipPip
  • 21 posts

Posted 10 February 2020 - 04:22 PM

The Perforce guide on backups says:

"The files that constitute the Helix server database, on the other hand, are not guaranteed to be in a state of transactional integrity if archived by a conventional backup program. Restoring the db.* files from regular system backups can result in an inconsistent database."

Is this always correct? Taking a checkpoint locks the database - what about shutting the server down? If we allow maintenance downtime during backups, is it okay to turn the Helix server off, take a snapshot of the disk containing the db.* files (and the versioned files) and restart the server? Are there situations where the database would be inconsistent in that use case?

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1192 posts

Posted 10 February 2020 - 05:11 PM

Checkpointing has some nice benefits over snapshotting the raw db.* files:

1. The fact that the checkpoint has to walk the entire the database gives you some assurance that the files are structurally sound.
2. The creation of the new checkpoint is synchronized with a rotation of the journal file, making it easy to recover transactions that happen in between checkpoints.
3. The checkpoint itself is both smaller and more portable than a db file backup.

None of the above are must-haves; you could verify your db snapshot offline, you could manage the journal rotation yourself (or parse out the timestamps during a recovery), portability doesn't matter unless/until you need to move your server, and disks are relatively cheap.  Checkpointing is all in all the most user-friendly way to make db recovery easy, though, as long as you can live with however much downtime it takes to create a checkpoint.

#3 Miles O'Neal

Miles O'Neal

    Advanced Member

  • Members
  • PipPipPip
  • 214 posts
  • LocationAustin. Texas. Y'all.

Posted 10 February 2020 - 05:56 PM

If you use the SDP, you only have to take a normal checkpoint once. After that, everything is journal-based with a nightly rebuild of the backup database, with no downtime except when you run the "weekly" script (which we run less often) to swap the freshly built database with the old. The downtime for that is minimal, as well.

#4 Miles O'Neal

Miles O'Neal

    Advanced Member

  • Members
  • PipPipPip
  • 214 posts
  • LocationAustin. Texas. Y'all.

Posted 10 February 2020 - 05:57 PM

We have a r/o replica as a backup server. We take it down and backup the versioned files and metadata so that we can more quickly spin up new servers or recover from a disaster. But we also have the checkpoints available.





Also tagged with one or more of these keywords: backup

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users