Server-side copy/move of a Perforce folder - without local sync of files
Asked Answered
I

2

8

On the project I'm currently working on, we have lots of folders in the /branches and /tags folders (left after the migration from Subversion to Perforce).

I want to clean up the mess - I want to move/copy/rename folders remotely, directly on the depot, without getting them locally. I can't get them locally because we're talking about hundreds of GB and probably millions of files - dozens of branches x ~5GB.

Is it possible to order Perforce to move the folders just on the server?

(I do not have direct access to the Perforce machine, I cannot move folders around on the server or update the Perforce database).

Imperturbation answered 10/4, 2012 at 19:38 Comment(1)
For a depot that size, you might want to email Perforce Support. If you haven't used them, Perforce's support is kinda legendary. Way better than the tech support you're probably used to.Anna
F
2

I think that you can construct a workspace that maps all the files in question. You can run sync -k to make Perforce think you have the files locally. Then you can run move -k to move the files on the server.

Just FYI, p4 copy creates a new branch, whereas p4 move moves an existing branch to a new location.

Finance answered 11/4, 2012 at 22:15 Comment(0)
A
8

p4 copy -v allows you to copy files in the depot without syncing those files to your workspace. (See the copy reference for more details.)

p4 delete -v allows you to delete files in the depot that are not synced to your workspace. (See the delete reference or KB Article #1148 for more details.)

Also p4 move -k allows you to move files in the depot without moving them locally, but I'm not sure if that applies if you don't have them synced to your workspace. (See the move reference for more details.)

You can also accomplish a move with a copy followed by a delete.

Anna answered 10/4, 2012 at 21:11 Comment(2)
Great. I missed the options when checking the command line options - presumably because my brain is hardwired by now to except -v to be "verbose" or "version" :) I'll test today.Imperturbation
p4 move -k doesn't actually work for what I need :( p4 delete -v says: Path '' is not under client '//myworkspace'. So no luck here either. p4 copy -v does what is says, mostly, and it creates a changelist that you have to submit. Still, the operations feel to heavy for what they're supposed to do (in most SCMs these kinds of operations just change a pointer/link/similar).Imperturbation
F
2

I think that you can construct a workspace that maps all the files in question. You can run sync -k to make Perforce think you have the files locally. Then you can run move -k to move the files on the server.

Just FYI, p4 copy creates a new branch, whereas p4 move moves an existing branch to a new location.

Finance answered 11/4, 2012 at 22:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.