Using p4 zip and unzip to export files from one perforce server to another

1.1k Views Asked by At

I was trying to export files along with their revision history inside my depot folder from 2015.2 to 2019 perforce server.Also , I would want perforce to create new user on my new server corresponding to the commiter/submitter on my original 2015 repo.

Perforce replicate looked like overkill for my current task and then I came across this read on perforce's website that mentioned P4 zip.

This looked like it will solve my problem, but the article has a few issues I could not understand.

Let's say I am moving data from server1_ip:port --> server2_ip:port

I am currently following these steps

  1. Making zip of folder to be copied using

    • p4 remote my_remote_spec , setting
    • Address: server1_ip:port
    • DepotMap://depot/... //depot2/...
  2. p4 -p server1_ip:port zip -o test.zip -r my_remote_spec -A //depot/.... But on this step I get permission denied error. This is weird to me because the user although not super/admin has access to files i ask to get zipped.

Also, when i did try with a super user, i could not find test.zip even though i was not prompted any errors.

  1. Isn't the above command supposed to generate a zip file inside the directory which i run it from?
  2. Is the unzip command supposed to be run after a p4 login from user of second server?
  3. Lastly, from the document why is a third port , 1667 mentioned in the transfer of files from server running on 1666 and 1777.
1

There are 1 best solutions below

6
On

on this step I get permission denied error. This is weird to me because the user although not super/admin has access to files i ask to get zipped.

This is expected:

C:\Perforce\test>p4 help zip

    zip -- Package a set of files and their history for use by p4 unzip

    ...

        The zip command requires super permission granted by p4 protect.

Isn't the above command supposed to generate a zip file inside the directory which i run it from?

Similar to p4 admin checkpoint, the zip file is written to the server machine (relative to the server root, if you don't specify an absolute path), rather than being transferred to the local client directory. This is not explicitly stated in the documentation (which seems like an oversight), but if you look in the root directory of the server where you ran the zip, you should find your test.zip there.

Is the unzip command supposed to be run after a p4 login from user of second server?

Yes, any time you run a command against a particular server, you will need to be logged in to that server. In the case of p4 unzip you will need at least admin permission on the second server.

Lastly, from the document why is a third port , 1667 mentioned in the transfer of files from server running on 1666 and 1777.

I'm pretty sure that's a typo; whoever wrote the article started off using ports 1666 and 1777, changed their mind halfway through, and didn't proofread. :)