Perforce Public Knowledge Base - Offline restore of a Perforce server
Downloads Blog Company Integrations Careers Contact Try Free
Menu Search
Reset Search



Offline restore of a Perforce server

« Go Back


How do I perform a restore from checkpoint on a replica?
How do I upgrade a master and replica from before 2013.3 to after 2013.3 with minimal downtime?
Note that Perforce 2013.3 and beyond requires a restore from a checkpoint as seen in Upgrading to 2013.3 and beyond.  This procedure will upgrade a master and replica that includes a restore from checkpoint.
  1. Upgrade your replica by reseeding
Your replica will be down, but your master will still be available during this time.   (If this is unacceptable, you can create another replica and then work with this new replica.)
              A.  Stop the replica server
              B.  Delete database and database related files

Delete the db files from the replica server root directory, and delete rdb.lbr and state as well. Also delete the journal from the replica.
              C.  Restore the most recent checkpoint using the newest executable (not the original executable) to the replica server root directory
cd <P4ROOT> p4d -r . -jr <checkpoint>
              D.  Upgrade the database
p4d -r . -xu
         You now have an upgraded replica.
               E. Restart the replica server
  1. Upgrade your master
               A.   Restore a recent checkpoint to a temporary directory
Restore the most recent checkpoint in another directory in the same filesystem as P4ROOT on the master machine using the newest p4d.  This way, you can use the "move" command to quick move a directory instead of waiting for a directory copy.
               B.  Rotate the running journal on the master server

This will create a numbered journal that can be played back into the temporary directory.
cd <master P4ROOT>
p4d -r . -jj
               C.  Replay the rotated numbered journal(s) into the temporary directory database
               D.  DOWNTIME:  Stop the master server
               E.  Replay the active journal into the temporary restored database using the new p4d:

cd <temp P4ROOT>
p4d -r . -jr <master P4ROOT>/journal
               F.   Run "p4d -r . -xu" on the restored database
p4d -r . -xu
               G.  Replace the db.* files
Move the db.* files out of production P4ROOT and move the newly restored db.* files from the temporary directory into the production P4ROOT.
     H.  UPTIME: Start the Perforce master

Perform sanity checks by logging in, looking at the key data such as the dates and times of submitted changelists.
  1. Create a checkpoint offline
Now that your master and replica are upgraded, this would be an ideal time to take a checkpoint. See our KB article on Offline Checkpoints.
A. Restore the same checkpoint you used in step 2A, and the rotated journal(s) using the latest binary to a temporary directory or your offline checkpoint directory
B. Upgrade the restored database using the -xu command
p4d -r . -xu
              C. Dump out a new checkpoint
                   p4d -r <offline directory> -jd -z <checkpoint_dir>/<checkpoint_name>.gz
Related Links



Was this article helpful?



Please tell us how we can make this article more useful.

Characters Remaining: 255