I was wondering if anyone had any advice on how to do the following task in p4v (I am not too familiar with P4V commands, so apologise if this is some basic command that I am missing).
Currently I have a workspace setup and data synced to my root
e.g. C:\Data\
I access this workspace from two different windows machine. (data is on both machines at c:\Data
Now, I need to move the location of where the data is stored on ONE of the machines and not the other (Machine A : c:\Data, Machine B: D:\Data\
Is this possible to do, without having to sync all the data again from the server (there is a lot and bandwidth limitations).
My initial thoughts were to create another workspace pointing to another root, but I do not know how to get this new workspace pick up the data files at this location.
Any help would be greatly appreciated
Thanks in advance
I don't know of a way to do this through P4V, but it can be done with the command line client. Here's the procedure.
After you have moved your files on machine B, and created a new workspace (without performing an "update all"), you can pass the -k switch to the sync command to let the server know what files you have.
From the web page to which I linked:
Keep existing workspace files; update the have list without updating
the client workspace. Use p4 sync -k only when you need to update the
have list to match the actual state of the client workspace.
And the command line help has this to say:
The -k flag updates server metadata without syncing files. It is
intended to enable you to ensure that the server correctly reflects
the state of files in the workspace while avoiding a large data
transfer. Caution: an erroneous update can cause the server to
incorrectly reflect the state of the workspace.
FYI: p4 flush is an alias for p4 sync -k
You can also look at the AltRoots field in the workspace. You could have one root at c:\data and the other at d:\data. As raven mentioned since the data is living on two separate disks you'll need to make sure that the data is kept in sync on both machines, although I assume you've already figured this part out since you've been running on two machines.
Any reason you can't just have one workspace per machine?
Related
I recently bought a dedicated server that has 2x480GB SSD. I installed Ubuntu1604-desktop_64 on it, then installed Perforce on it following Michael Allar's tutorial : https://youtu.be/5krob9SlVu4. Everything went well, I populated the server with my files with P4V, but was surprised to see that I apparently only have 20GB storage.
By using PuTTY, I connected to the server and with the df -h command, here's what it shows me :
Server space
From what I see, the Perforce server is on /dev/md1, and only has 20GB of storage. It seems it would be way better to have it on /dev/md2, that has 399GB available. Is there a way that I can transfer the Perforce server/depot to that drive instead?
Thank you!
You will need to log in to the server and move the actual files, and let Perforce know where you moved them to. The two directories you might be concerned with are:
the server root. This is defined by your P4ROOT environment variable, or the -r flag on the p4d startup command. The server root is where the database files (db.*) live. It's also by default where everything else lives, although in practice for best performance/reliability it's generally recommended to have the db on its own drive and configure checkpoints and archives to live elsewhere.
the depot(s). This is defined by the Map: field in the p4 depot spec. The depot is where actual file content lives (usually the bulk of the data in a Perforce server, and also infrequently accessed relative to the database -- it's pretty common to put the depot on a larger slower disk/RAID while having the db on an SSD). By default this is a relative path (and interpreted relative to P4ROOT), but you can set it to an absolute path.
Decide which of those you're moving, move it, and update the corresponding configuration (i.e. P4ROOT if you moved the server root, or the depot Map if you moved the depot).
for a project I usually create several workspaces on the same host to work on different aspect of the project. However I've find that the workspaces that I stop using for more than a couple weeks disappears(I don't interact with it through command line or GUI). and I'd get a 'clientroot missing' error. The workspace folder is still on my local drive. Is there a limit to how many workspace one can create on 1 host/how long a workspace can stay inactive before being deleted? Is there a way for me to get it back somehow?
Thanks!
This isn't normal behavior for Perforce and my guess is that your admin is running some sort of home-made cleanup script, which is probably unnecessary or at the very least overzealous (unless you're using the free version and limited on how many workspaces you can create, in which case I'd suggest changing your workflow to not burn so much of a limited resource).
If that is the case, you'll need to talk to your admin about exactly what the rules are and whether the workspaces are being archived in any way before they're purged.
We have two perforce servers. I need to copy everything from depot on one server to depot on another server. The copy command doesn't take into account different servers.
Is it possible?
You didn't mention if you just need the head revisions or if you need full history, whether this is a one-time request or part of a regular process, whether both servers are under your control, etc.
So some of this is speculation, but here's three possible ways:
Create a workspace for each server, both pointing to the same place on your workstation. Sync the files from the source server, then submit them to the target server.
Create a remote depot on the target server, pointing to the source server. Then integrate the files from the remote depot to their desired location in the target server.
Use the P4Transfer utility: https://swarm.workshop.perforce.com/projects/perforce-software-p4transfer/
If none of these seem appropriate for you, perhaps you have special needs. There are a number of other options available, including special tools that need some assistance to use, but if you find you have such custom needs you should contact Perforce Technical Support for more precise guidance.
I need to copy a depot from one Perforce server to another. The file revision history needs to be intact but the user information and workspace information can not be copied to the new server.
I've tried a standard checkpoint creation and restore procedure, but if there exist users or workspaces with the same name on both servers, the source server will overwrite this info on the destination server. This is pretty bad if those user accounts and workspaces do not have exactly identical details.
The goal of this sort of operation is to allow two separate, disconnected groups to view a versioned source tree with revision history. Updates would be single directional with one group developing and one just viewing. Each group's network is completely enclosed, no outside connections of any kind.
Any ideas would be appreciated, i've been busting my brains on this one for a while.
EDIT:
Ultimately my solution was to install an intermediate Perforce server on the same machine as my source server. Using that I could do a standard backup/restore from the source server to the intermediate server and then delete all unwanted meta data in the intermediate server before backing up from the intermediate server to the final destination server. Pretty complicated but it got the job done and it can all be done programatically in Windows Power Shell.
There are a few ways, but I think you are going about this one the hard way.
Continue to do what you are doing, but delete the db.user, db.view(I think) and db.group. Then when you start the perforce server, it will create these, but they will be empty, which will make it hard for anyone to log in. So you'll have to create users/groups. I'm not sure if you can take those db files from another server and copy them in, never tried that.
The MUCH easier way, make a replica. http://www.perforce.com/perforce/r10.2/manuals/p4sag/10_replication.html Make sure you look at the p4d -M flag to make sure it's a read only replica. I assume you have a USB drive or something to move between networks, so you can just issue a p4 pull onto the USB drive, then move the drive, and either run it off the USB, or issue another p4 pull, pulling to a final server. Never tried this, but with some work it should be possible, you'll have to run a server off the USB to issue the final p4 pull.
You could take a look at perforce git fusion, and make some git clones.
You could also look at remote depots. Basically you create a new depot on your destination server, and point it at a depot on your source server. This works if you have a fast connection between the 2 servers. Protections are handled by the destination server, as to who has access to that new depot. The source server can be set up to share it out as read only to the destination server. Here is some info
http://answers.perforce.com/articles/KB_Article/Creating-A-Remote-Depot
Just make sure you test it during a slow period, as it can slow down the destination server. I tried it from 2 remote locations, both on the east coast US, and it was acceptable, but not too useful. If both servers are in the same building it would be fine.
I did a migration of the perforce server. Because there are many depots and many data and because our department does not want that the server is down for a day, I did the following:
Step 2 : Stop the 'old' perforce server on machine A
Step 1 : Copy all data from machine A to machine B
Step 2 : Start again the 'old' server
Setp 3 : Do the complete migration and start the new server at machine B
Now the problem is that in the meanwile, there are several changelists submitted to machine A.
Is there an easy way to copy the changes to machine B ? Note that I have a checkpoint, so the metadata is not the problem.
I know that on version controls like git it is easy with patches. Is such a thing also possible in perforce in an easy way?
You may want to look at p4 pull and p4 replicate command given by perforce.
P4 Pull and P4 Replicate are the 2 commands given for purpose like these. I am assuming that your p4 server is p4d 2010.2 or above for these commands.
Also, I would recommend you reading Perforce's knowledge base for their article on Offline check pointing. This article is not a direct solution to your problem, but it gives you insight of how you may tackle your situation.
Hope this helps.
Did you truncate your journal when you did the first migration? If so, you can probably replay the latest production journal and then rsync/robocopy the archive content (files in the depots). That'll let you catch up.
I assume this is a one-off activity?
You should probably check in with Perforce tech support just to make sure you're not overlooking anything.