简体   繁体   English

使用 p4 zip 并解压缩以将文件从一个 perforce 服务器导出到另一个

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

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.我试图从 2015.2 到 2019 年 perforce 服务器在我的 depot 文件夹中导出文件及其修订历史记录。此外,我希望 perforce 在我的新服务器上创建新用户,该用户对应于我原始 2015 回购中的提交者/提交者。

Perforce replicate looked like overkill for my current task and then I came across this read on perforce's website that mentioned P4 zip.对于我当前的任务,Perforce 复制看起来有点矫枉过正,然后我在 perforce 的网站上看到了这篇文章,其中提到了 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假设我正在从 server1_ip:port --> server2_ip:port 移动数据

I am currently following these steps我目前正在执行这些步骤

  1. Making zip of folder to be copied using使用 zip 制作要复制的文件夹

    • p4 remote my_remote_spec , setting p4 remote my_remote_spec ,设置
    • Address: server1_ip:port
    • DepotMap://depot/... //depot2/...
  2. p4 -p server1_ip:port zip -o test.zip -r my_remote_spec -A //depot/... . 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.此外,当我尝试使用超级用户时,即使没有提示任何错误,我也找不到 test.zip。

  1. Isn't the above command supposed to generate a zip file inside the directory which i run it from?上面的命令不是应该在我运行它的目录中生成一个 zip 文件吗?
  2. Is the unzip command supposed to be run after a p4 login from user of second server?是否应该在第二台服务器的用户 p4 登录后运行 unzip 命令?
  3. Lastly, from the document why is a third port, 1667 mentioned in the transfer of files from server running on 1666 and 1777.最后,从文件为什么是第三个端口,1667 中提到从运行在 1666 和 1777 上的服务器传输文件。

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?上面的命令不是应该在我运行它的目录中生成一个 zip 文件吗?

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.p4 admin checkpoint类似,zip 文件被写入服务器计算机(相对于服务器根目录,如果您未指定绝对路径),而不是传输到本地客户端目录。 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.这在文档中没有明确说明(这似乎是一个疏忽),但是如果您查看运行 zip 的服务器的根目录,您应该在那里找到您的test.zip

Is the unzip command supposed to be run after a p4 login from user of second server?是否应该在第二台服务器的用户 p4 登录后运行 unzip 命令?

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.p4 unzip的情况下,您至少需要第二台服务器的admin权限。

Lastly, from the document why is a third port, 1667 mentioned in the transfer of files from server running on 1666 and 1777.最后,从文件为什么是第三个端口,1667 中提到从运行在 1666 和 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.写这篇文章的人开始使用端口 1666 和 1777,中途改变了主意,并且没有校对。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM