{"id":4563,"date":"2018-01-08T13:22:33","date_gmt":"2018-01-08T13:22:33","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=4563"},"modified":"2021-02-27T09:09:52","modified_gmt":"2021-02-27T09:09:52","slug":"recovery-procedures-in-perforce-server","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce-server\/","title":{"rendered":"Recovery Procedures in Perforce Server"},"content":{"rendered":"<h2>Recovery Procedures in Perforce Server<\/h2>\n<p>If the database files become corrupted or lost, either because of disk errors, a hardware failure such as a disk crash, the database can be recreated with your stored checkpoint and journal. it can at least provide a general guideline for recovery from the two most common situations, specifically:<\/p>\n<p>1. corruption of your Perforce database only, without damage to your versioned files, and<br \/>\n2. corruption to both your database and versioned files.<\/p>\n<h2><strong>Case 1: Database corruption, versioned files unaffected<\/strong><\/h2>\n<p><strong>You will need:<\/strong><br \/>\n1. The last checkpoint file, which should be available from the latest P4ROOT directory backup.<\/p>\n<p>2. The current journal file, which should be on a separate filesystem from your P4ROOT directory, and which should therefore have been unaffected by any damage to the filesystem where your P4ROOT directory was held.<\/p>\n<p><strong>You will not need:<\/strong><br \/>\n1. Your backup of your versioned files; if they weren\u2019t affected by the crash, they\u2019re already up to date.<\/p>\n<p><strong>To recover the database<\/strong><\/p>\n<p>1. Stop the current instance of p4d:<\/p>\n<p>p4 admin stop<\/p>\n<p>(You must be a Perforce superuser to use p4 admin.)<\/p>\n<p>2. Rename (or move) the database (&#8220;db.*&#8221;) files:<\/p>\n<p>mv your_root_dir\/db.* \/tmp<\/p>\n<p>There can be no db.* files in the $P4ROOT directory when you start recovery from a checkpoint. Although the old db.* files are never used during recovery, it\u2019s good practice not to delete them until you\u2019re certain your restoration was successful.<\/p>\n<p>3. Invoke p4d with the -jr (journal-restore) flag, specifying your most recent checkpoint and current journal. If you explicitly specify the server root ($P4ROOT), the -r $P4ROOT argument must precede the -jr flag:<\/p>\n<p>p4d -r $P4ROOT -jr checkpoint_file journal_file<\/p>\n<p>This recovers the database as it existed when the last checkpoint was taken, and then apply the changes recorded in the journal file since the checkpoint was taken.<\/p>\n<h2>Case 2: Both database and versioned files lost or damaged<\/h2>\n<p><strong>You will need:<\/strong><br \/>\n1. The last checkpoint file, which should be available from the latest P4ROOT directory backup.<br \/>\n2. Your versioned files, which should be available from the latest P4ROOT directory backup.<\/p>\n<p><strong>You will not need:<\/strong><\/p>\n<p>Your current journal file. The journal contains a record of changes to the metadata and versioned files that occurred between the last backup and the crash; because you\u2019ll be restoring a set of versioned files from a backup taken before that crash, the checkpoint alone contains the metadata useful for the recovery, and the information in the journal is of limited or no use.<\/p>\n<p><strong>To recover the database<\/strong><\/p>\n<p>1. Stop the current instance of p4d:<\/p>\n<p>p4 admin stop<br \/>\n(You must be a Perforce superuser to use p4 admin.)<\/p>\n<p>2. Rename (or move) the corrupt database (&#8220;db.&#8221;) files:<br \/>\nmv your_root_dir\/db.* \/tmp<\/p>\n<p>The corrupt db.* files aren\u2019t actually used in the restoration process, but it\u2019s safe practice not to delete them until you\u2019re certain your restoration was successful.<\/p>\n<p>3. Invoke p4d with the -jr (journal-restore) flag, specifying only your most recent checkpoint:<\/p>\n<p>p4d -r $P4ROOT -jr checkpoint_file<\/p>\n<p><strong>Some Tips While Setting up Perforce Server Configuration to have best Backup &amp; Recovery methodlogy<\/strong><\/p>\n<p>1. Make sure you are using Symbolic Links for storing versioned files in another drive<br \/>\n2. Make sure you are Storing Journal files in differnet directory<br \/>\n2. Make sure you are storing check points in different directory<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recovery Procedures in Perforce Server If the database files become corrupted or lost, either because of disk errors, a hardware [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[22],"tags":[373,4484,4486,4485],"class_list":["post-4563","post","type-post","status-publish","format-standard","hentry","category-perforce","tag-perforce","tag-perforce-backup-and-recovery","tag-perforce-recovery-process","tag-perforce-server-recovery-procedures"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Recovery Procedures in Perforce Server - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Recovery Procedures in Perforce Server - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"Recovery Procedures in Perforce Server If the database files become corrupted or lost, either because of disk errors, a hardware [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce-server\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2018-01-08T13:22:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-27T09:09:52+00:00\" \/>\n<meta name=\"author\" content=\"scmgalaxy K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"scmgalaxy K\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce-server\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce-server\\\/\"},\"author\":{\"name\":\"scmgalaxy K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"headline\":\"Recovery Procedures in Perforce Server\",\"datePublished\":\"2018-01-08T13:22:33+00:00\",\"dateModified\":\"2021-02-27T09:09:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce-server\\\/\"},\"wordCount\":566,\"commentCount\":0,\"keywords\":[\"Perforce\",\"Perforce Backup and Recovery\",\"Perforce Recovery Process\",\"Perforce Server Recovery Procedures\"],\"articleSection\":[\"Perforce\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce-server\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce-server\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce-server\\\/\",\"name\":\"Recovery Procedures in Perforce Server - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"datePublished\":\"2018-01-08T13:22:33+00:00\",\"dateModified\":\"2021-02-27T09:09:52+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce-server\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce-server\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce-server\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Recovery Procedures in Perforce Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\",\"name\":\"scmgalaxy K\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"caption\":\"scmgalaxy K\"},\"sameAs\":[\"http:\\\/\\\/www.DevOpsSchool.com\"],\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/scmgalaxy\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Recovery Procedures in Perforce Server - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce-server\/","og_locale":"en_US","og_type":"article","og_title":"Recovery Procedures in Perforce Server - scmGalaxy","og_description":"Recovery Procedures in Perforce Server If the database files become corrupted or lost, either because of disk errors, a hardware [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce-server\/","og_site_name":"scmGalaxy","article_published_time":"2018-01-08T13:22:33+00:00","article_modified_time":"2021-02-27T09:09:52+00:00","author":"scmgalaxy K","twitter_card":"summary_large_image","twitter_misc":{"Written by":"scmgalaxy K","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce-server\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce-server\/"},"author":{"name":"scmgalaxy K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"headline":"Recovery Procedures in Perforce Server","datePublished":"2018-01-08T13:22:33+00:00","dateModified":"2021-02-27T09:09:52+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce-server\/"},"wordCount":566,"commentCount":0,"keywords":["Perforce","Perforce Backup and Recovery","Perforce Recovery Process","Perforce Server Recovery Procedures"],"articleSection":["Perforce"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce-server\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce-server\/","name":"Recovery Procedures in Perforce Server - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"datePublished":"2018-01-08T13:22:33+00:00","dateModified":"2021-02-27T09:09:52+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Recovery Procedures in Perforce Server"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102","name":"scmgalaxy K","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","caption":"scmgalaxy K"},"sameAs":["http:\/\/www.DevOpsSchool.com"],"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/scmgalaxy\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/4563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=4563"}],"version-history":[{"count":1,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/4563\/revisions"}],"predecessor-version":[{"id":4564,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/4563\/revisions\/4564"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=4563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=4563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=4563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}