How do I move folders between Perforce "depots"
Asked Answered
V

3

6

After deleting my Svn repo by accident the other day I wanted to try something else and I have chosen Perforce as my current versioning tool testing ground. It is going great and I am liking what am seeing in Perforce.

Here is my problem. I have submitted my files to my Perforce server and then used my client pcs to grab those projects from the master Perforce server. Now all works great except that I realized that it is possible to use more than a single "depot" in Perforce, and it makes sense to me that I should just move some of those projects to another depot fpr the sake of organization and and maybe for security reasons inn case.

I have been looking for some answers, and I have found couple of them however I am unable to produce any intended results thus I am looking for some expert advice here.

One of the pages I have tried is this one

http://kb.perforce.com/article/24/renaming-depot-directories

Seems to offer a solution, however I have not been able to move files from one depot to another depot that is on the same server process. The examples in the page works fine for moving some folder to a folder in the same depot. The example seems to demonstrate moving to another folder under the same depot.

So I am looking for a reasonable and safe way to move my master Perforce depot folders to another depot that is on the same server, and naturally without loosing any work.

Here is what I am wanting

-- Current

//Depot-A
 -->folder1
 -->folder2

-- I want

//Depot-A
 -->folder1

//Depot-B
 -->folder2

thanks

Vowel answered 12/11, 2012 at 5:34 Comment(0)
H
5

Moving files between different depots is no different than moving files between folders within the same depot, with the exception that the target depot must already exist. Using your example, and assuming "Depot-B" doesn't exist yet, to move "folder2" from "Depot-A" to "Depot-B", you would simply do this:

p4 depot Depot-B
p4 edit //Depot-A/folder2/...
p4 move //Depot-A/folder2/... //Depot-B/folder2/...
p4 submit
Hesse answered 13/11, 2012 at 13:44 Comment(2)
You do need to define Depot-B first. You can do that with the 'p4 depot' command. Depots can have separate physical storage on the server so they require a short definition.Geometrize
@p4-randall: Thanks, I modified my answer. I guess depots are a little bit special.Hesse
L
0

Here's what I would do (in a nutshell): If you open a P4V session and select the submitted changelists tab, you can filter this set to show only the changes that relate to the section you want to move. This is the change set you will duplicate on the new depot (or even server) that you want to populate. The idea is that you are unraveling the archive files on one side and winding them up in the identical way at the destination. So the process is simply (1) syncing to the first changelist, (2) integrating that set across to the new location, (3) checking that set in, and (4) proceed to the next changelist. Obviously this can be scripted. I am currently in the process of working a script up in python, but any decent scripting language with Perforce function libraries will work. A couple of complications: The changelists will be sequentially the same as the originals, but the original times will not - they will be "current". And of course if there are labels, you'll need to map that out in the new location if you want them preserved.

Limacine answered 7/11, 2014 at 16:5 Comment(0)
A
-1

I don't think additional depots add much in the way of security. Multiple depot scenarios primarily arise in very large installation.

The primary benefit of additional depots is that you can gain more control over the disk space layout of your server, for example if your repository is too large to fit onto a single filesystem and you need to expand it to use multiple filesystems. A secondary reason to create additional depots is if you have to have depots of specialized types; for example if you wish to create a Streams depot to use the Perforce Streams feature.

For a scenario such as the one you describe, having all your files under Depot A is probably fine for the foreseeable future.

Arrive answered 12/11, 2012 at 15:7 Comment(1)
Bryan Pendleton, thanks for the insight. However I would like to know how that is done really for the future needs.Vowel

© 2022 - 2024 — McMap. All rights reserved.