{"id":1720,"date":"2017-12-06T04:59:47","date_gmt":"2017-12-06T04:59:47","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=1720"},"modified":"2021-02-27T09:31:11","modified_gmt":"2021-02-27T09:31:11","slug":"recovery-procedures-in-perforce","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce\/","title":{"rendered":"Recovery Procedures in Perforce"},"content":{"rendered":"<p><strong>rajeshkumar created the topic: Recovery Procedures in Perforce<\/strong><br \/>\nIf 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.<\/p>\n<p>it can at least provide a general guideline for recovery from the two most common situations, specifically:<br \/>\n1. 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<p>Case 1: Database corruption, versioned files unaffected<\/p>\n<p>You will need:<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<br \/>\ndirectory, and which should therefore have been unaffected by any damage to the<br \/>\nfilesystem where your P4ROOT directory was held.<\/p>\n<p>You will not need:<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>To recover the database<\/p>\n<p>1. Stop the current instance of p4d:<br \/>\np4 admin stop<br \/>\n(You must be a Perforce superuser to use p4 admin.)<\/p>\n<p>2. Rename (or move) the database (&#8220;db.*&#8221;) files:<br \/>\nmv 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:<br \/>\np4d -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<p>Case 2: Both database and versioned files lost or damaged<\/p>\n<p>You will need:<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>You will not need:<\/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>To recover the database<\/p>\n<p>1. Stop the current instance of p4d:<br \/>\np4 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:<br \/>\np4d -r $P4ROOT -jr checkpoint_file<\/p>\n<p>Some Tips While Setting up Perforce Server Configuration to have best Backup &#038; Recovery methodology<\/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<br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\">twitter.com\/RajeshKumarIn<\/a><\/p>\n<p><strong>rajeshkumar replied the topic: Re: Recovery Procedures in Perforce<\/strong><br \/>\nReference can be found in following link&#8230;<br \/>\n<a href=\"http:\/\/community.scmgalaxy.com\/pg\/blog\/rajeshku...s-in-perforce-server\">community.scmgalaxy.com\/pg\/blog\/rajeshku&#8230;s-in-perforce-server<\/a><br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\">twitter.com\/RajeshKumarIn<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>rajeshkumar created the topic: Recovery Procedures in Perforce If the database files become corrupted or lost, either because of disk [&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":[370],"tags":[373],"class_list":["post-1720","post","type-post","status-publish","format-standard","hentry","category-perforce-version-control-systems","tag-perforce"],"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 - 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\/\" \/>\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 - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"rajeshkumar created the topic: Recovery Procedures in Perforce If the database files become corrupted or lost, either because of disk [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-06T04:59:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-27T09:31:11+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\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce\\\/\"},\"author\":{\"name\":\"scmgalaxy K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"headline\":\"Recovery Procedures in Perforce\",\"datePublished\":\"2017-12-06T04:59:47+00:00\",\"dateModified\":\"2021-02-27T09:31:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce\\\/\"},\"wordCount\":606,\"commentCount\":0,\"keywords\":[\"Perforce\"],\"articleSection\":[\"Perforce\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce\\\/\",\"name\":\"Recovery Procedures in Perforce - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"datePublished\":\"2017-12-06T04:59:47+00:00\",\"dateModified\":\"2021-02-27T09:31:11+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/recovery-procedures-in-perforce\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Recovery Procedures in Perforce\"}]},{\"@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 - 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\/","og_locale":"en_US","og_type":"article","og_title":"Recovery Procedures in Perforce - scmGalaxy","og_description":"rajeshkumar created the topic: Recovery Procedures in Perforce If the database files become corrupted or lost, either because of disk [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce\/","og_site_name":"scmGalaxy","article_published_time":"2017-12-06T04:59:47+00:00","article_modified_time":"2021-02-27T09:31:11+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\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce\/"},"author":{"name":"scmgalaxy K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"headline":"Recovery Procedures in Perforce","datePublished":"2017-12-06T04:59:47+00:00","dateModified":"2021-02-27T09:31:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce\/"},"wordCount":606,"commentCount":0,"keywords":["Perforce"],"articleSection":["Perforce"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce\/","name":"Recovery Procedures in Perforce - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"datePublished":"2017-12-06T04:59:47+00:00","dateModified":"2021-02-27T09:31:11+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/recovery-procedures-in-perforce\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Recovery Procedures in Perforce"}]},{"@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\/1720","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=1720"}],"version-history":[{"count":1,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/1720\/revisions"}],"predecessor-version":[{"id":1721,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/1720\/revisions\/1721"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=1720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=1720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=1720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}