[p4] How to restore an obliterated branch from the backed up checkpoint
gb.perforce at googlemail.com
Wed Oct 28 07:28:26 PDT 2009
On Wed, Oct 28, 2009 at 1:02 PM, Alok Narula <anarula at beceem.com> wrote:
> I'm aware of the following command to restore a Perforce server from a
> p4d -r $P4ROOT -jr checkpoint_file journal_file
> But when I use this command, I will restore the entire P4 Depot. How can
> I restore only one obliterated branch from the backup?
In a nutshell, you don't. Obliterating removes data in a way that is
irreversible. And Perforce's checkpoint is merely a database dump. You
can't partially restore a Perforce database, it wouldn't make sense as
all groups of database tables have a chronological integrity that must
Having said that there may be ways to get at least some or all of your
branch back. It really depends on what has been obliterated and what
you are interested in retrieving (just the #head revision on that
branch or all its history ?). From the top of my head:
1- If the data (another branch) that created that branch is still on
the depot then why not re-integrating that ? (Even more obvious, if
that obliterated branch had a clone branch or close enough, then 'p4
duplicate' could help).
2- Similarly, if your obliterated branch has been branched somewhere
else, could it be re-created from that ?
3- You could restore your checkpoint (that contains the branch) and
corresponding RCS archive to a separate Perforce domain, and mount the
relevant branch as a remote depot (on your production server) from
which you integrate to re-create the missing branch. This will enable
you to pick and choose the relevant milestones.
4- The sledge-hammer method: as 3, you restore a separate Perforce
domain from your checkpoint / RCS and p4 obliterate everything but
your branch. This leaves you with a small depot containing just your
branch. You merge this depot with your live one using perfmerge++.
It's an involved process, but would restore all your branch history.
It wouldn't re-conciliate its integration history, unfortunately and
some changelists would be renumbered.
5- If you have preserved all your journal entries since that
checkpoint, you could restore the checkpoint (and the missing RCS, if
any) and replay all journals skipping the obliteration (so a journal
would need to be edited). I am only speculating that this would work
and would require assistance from Perforce Support. This should
restore everything as if the obliteration never occurred.
1, 2 and 3 do not require any downtime but do not restore the same
file and integration history as before.
4 and 5 require downtime and dry runs on a test environment, etc...
Maybe Perforce Support has another method up their sleeves. Talk to
them first anyway.
Good luck !
More information about the perforce-user