Renaming workspace root path in perforce

aman picture aman · Jul 3, 2017 · Viewed 10.2k times · Source

I have two perforce workspace roots in the same directory on Windows. For example:

C:\Perforce_windows_workspaces\wkspc1

C:\Perforce_windows_workspaces\wkspc2

I need to rename the folder "Perforce_windows_workspaces" to something smaller (say p4wkspcs), so that the new paths to the roots will be:

C:\p4wkspcs\wkspc1

C:\p4wkspcs\wkspc2

respectively.

Will renaming the folder directly in the file system lead to any issues in the root mappings? If so, how can I go about reflecting those changes in the P4V application?

Answer

Bartek Kobyłecki picture Bartek Kobyłecki · Jul 3, 2017

Definition form of Perforce workspace contains root directory field that can be changed.

To change the workspace root without transferring all data from perforce do following steps:

  1. Go to P4V, View > Workspaces. Then right-click on the workspace and pick "Edit workspace '...'". Change the workspace root and confirm the change without synchronizing the workspace. (You will be prompt to sync the workspace; cancel that operation)
  2. Rename the directory on the file system
  3. Perform synchronization check to verify that everything is all right.

    p4 sync -n //client.name/...

  4. P4V will still show the old path in the workspace view. Go to "Search->Filter Workspace->Workspace Root" and it will be updated.

The order of step 1 and 2 doesn't matter.