4
votes

In Perforce, is it possible to rename a depot?

I would imagine that you could integrate across different named depots, but I do not think that would carry over the full depot's history.

I have seen this Renaming Depot Directories article, but this applies only to directories under a depot (and not the depot itself).

3

3 Answers

3
votes

No. You can't rename a depot because Perforce won't let you move files from depot A to depot B unless depot B already exists. If you wish to rename depot A to depot B, do the following:

  • create a depot named B
  • move all files in A to B
  • delete depot A

It used to be that moving files to a new location in Perforce meant you lost their history. The old file was deleted and then added again in the new location as though it had never been under version control. That is no longer the case. I don't recall exactly when they did it (perhaps in the 2008.x series?), but they finally made it so that file history is maintained across a move/rename/integration.

Edit: In the comments below, Greg Whitfield informs me that Perforce has been maintaining file history across integrations all along. I guess it was off by default and turned on in a fairly recent version of P4V?

1
votes

Contact Perforce support. They can guide and support you through the process of actually renaming a depot, which involves manipulating the metadata.

0
votes

Disclosure: I work for Perforce.

Whatever you plan to do - do test it before putting your data at risk. :)

Supported version (online):

http://answers.perforce.com/articles/KB_Article/Renaming-Depot-Directories

Unsupported version (offline):

Unsupported version (online):

p4 duplicate //olddepot/... //newdepot/...

p4 snap //newdepot/... //olddepot/...

p4 verify -q //newdepot/...

(check for any error, stop and contact support if in doubt)

p4 obliterate //olddepot/...

May Perforce be with you.