How do I move a Perforce "workspace" folder?

DirectoryPerforceMove

Directory Problem Overview


I've just downloaded a 4.5GB depot to a location on my hard drive that is not ideal.

I'd like to move the folder that Perforce now sees as the "workspace" folder (iPhone) to another folder on my hard disk (Project Name), and then use that folder as the workspace folder.

Is this possible, or do I need to download the entire depot again?

Thanks, Dave

Directory Solutions


Solution 1 - Directory

in the P4V application:

Open the Workspace dialog: Go to Connection>Edit Current Workspace... change "Workspace root:" to where you like

If you have not already moved the files, P4V will offer to copy them for you.

Solution 2 - Directory

As long as you know what changelist you last synced to, you can do this without having to sync again. Here's how:

  1. Note the last changelist synced
  2. Copy/move the folder to the new location
  3. Update your workspace (either the root, or the depot mapping) to point at the new location
  4. Run p4 flush //depot/path/to/folder/...@<last_changelist>

The flush command tells the server that you have the files at the path specified, at the changelist specified. It's a synonym for p4 sync -k.

Solution 3 - Directory

Mike's answer is almost correct, except that the p4 sync -k is not required when moving a workspace (changing the root). P4 does not care where the root is, it only tracks the files on your machine by workspace/client name.

If you wanted to change the workspace name (which would require you to create a new workspace) and populate it with files from an already synced workspace, you would then need to run p4 sync -k to let the server know that this new workspace has these files at @changeset.

Solution 4 - Directory

If you are using any client (ie: P4V), then you can edit workspace and change the root to the new workspace path.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDave StewartView Question on Stackoverflow
Solution 1 - DirectoryOfir AttalView Answer on Stackoverflow
Solution 2 - DirectoryMike O'ConnorView Answer on Stackoverflow
Solution 3 - DirectoryDennisView Answer on Stackoverflow
Solution 4 - DirectorytanjirView Answer on Stackoverflow