Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

perforce backup question

Tags:

perforce

for safety purpose, is it enough to backup all the files under perforce server directory?

like image 647
user496949 Avatar asked Dec 28 '22 03:12

user496949


2 Answers

Short answer: No
Long answer: All you need to know about backup and recovery of Perforce data is detailed in the Manual. In a nutshell for the impatient:

  1. p4 verify //...
    (Verify the integrity of your server)
  2. p4 admin checkpoint
    (Make a checkpoint; make sure that this step is successful)
  3. back up the checkpoint file and the old journal file
    (if you run Perforce with Journal files, which you should)
  4. back up your versioned files
    (that's the actual data, not to be confused with the db.* files in the Perforce server directory.)

But please do read the manual, especially about the various restore scenarios. Remember: Backups usually work fine, it's the restore that fails.

like image 140
jhwist Avatar answered Jan 24 '23 14:01

jhwist


In addition to jhwist's correct from the p4 manual answer (permalink) I would like to add a few things that I've learnt during using Perforce for several years.

...

Depending on the size of your repository performing a verify on the p4 database can take several hours, which during it will be locked and no one will be able to perform any queries. Locking the P4 database can have several on flow effects to your users, for example: if someone is using or attempts to use P4 during this time a P4SCC plug-in (ie. for visual studio integration) it will spin and the user will eventually have to force quit to regain control.

Solution

  1. Spawn a second instance of P4D on a different port (p4d_2)
  2. Suspend/terminate the main instance (p4d_1).
  3. Perform the p4 verify //... and checkpoint using p4d_2.
  4. Backup the physical version files on the storage array.
  5. Kill p4d_2.
  6. Restart p4d_1.

Also: As this will be more than likely be an automated process run at night or over the weekend can cannot stress enough that you need to thoroughly read the checkpoint log file to ensure that it was successful otherwise you will be in a difficult spot when you need to perform a restore (read the next point). Backup should not be a set and forget procedure.

Further information about Perforce backup can be found in Perforce whitepaper: High Availability And Disaster Recovery Solutions For Perforce.

HTH,

like image 30
Dennis Avatar answered Jan 24 '23 14:01

Dennis