Moving the Perforce Server
PROBLEM
How do I move a Perforce server from one machine to another?
SOLUTION
This article describes how to move your Perforce Server between machines with identical case-sensitivity, architecture and text file format. For information on how to migrate your Perforce Server between machines with different case-sensitivities, architectures and/or text file formats, please consult Cross-Platform Perforce Server Migration. Consider the questions below; if you answer "No" to any of these questions you should perform a cross-platform migration:
- Do both machines deal with case-sensitivity the same way?
Windows is case-insensitive, UNIX-based operating systems are typically case-sensitive but Mac OS X is case-insensitive.
- Do both machines store text files with the same line-ending format?
Windows uses CR/LF, UNIX-based operating systems use LF.
- Do both machines store numbers the same way?
X86-based machines are little-endian, PPC and SPARC are big-endian.
If you answered "Yes" to all of the questions above, then you can
safely move your Perforce Server using the method described below. If
not, please consult Cross-Platform Perforce Server Migration.
To move your Perforce Server between machines with identical case-sensitivity, architecture, and text file format you should:
- Update your license
If the IP address of the new machine is different from the old machine and you are a currently licensed Perforce customer, you must get a new license file to reflect the new IP address. Contact us for an updated license.
- Install Perforce
If you have not already done so, install the Perforce Server software on the new machine. You should use the same release on the new machine as on the original machine; however, you can update to the latest patch of that release. For more information on how to install Perforce, consult our System Administrator's Guide.
- Verify the archive files
To ensure that you do not have any missing or corrupted archive files to begin with, run the following command on the original server (if you have multiple depots you need to verify each depot):
p4 verify -q //depot/... > verify.errors
If you encounter any errors, please contact Perforce Support at support@perforce.com for assistance.
- Compute missing checksums
To provide signatures for any files that do not already have them, run the following command on the original server (if you have multiple depots you need to verify each depot):
p4 verify -qu //depot/... > verify.update
This will allow all revisions of all files to be checked following the move.
- Stop the server
Run "p4 admin stop" to shut down the original Perforce Server. This will prevent access to the server while you relocate it.
- Copy the server root directory
Copy the entire contents of the original Perforce Server's root directory (P4ROOT) to the new machine. This must include all db.* files and any depot subdirectories. You can use tar and ftp or any other method you are comfortable with.
-
Install your new license file
Copy the new license file into the new server's P4ROOT in place of the old license file.
- Start the new server privately
This step is optional, but recommended. To prevent unwanted connections while you are working on the new server, use "localhost" for the P4PORT setting when you start the server (this will deny remote connections), or start the server on a non-standard port. For example:
p4d -r P4ROOT -p localhost:1666 or: p4d -r P4ROOT -p 6666
For more information on how to configure and start Perforce, consult our System Administrator's Guide.
- Re-verify the archive files
To ensure that all archive files were copied successfully, run p4 verify on the new server using the same command(s) as in step three above. If you encounter any errors, confirm that the archive files were successfully copied into the correct location and, if necessary, contact Support for assistance.
- Restart the new server
You can now stop and restart the new server for everyone on your network to access. To stop the server, run the "p4 admin stop" command as in step five. Consult our System Administrator's Guide for more information on how to configure and start Perforce.
Note:
In addition to the steps detailed above, be advised that you will need to account for your automated processes. For example, you might need to update or migrate: custom triggers, daemons (such as the review daemon or p4thumb), and cronjobs or scheduled tasks (such as your backup routine).
If the hostname of the new machine is different, users must change their P4PORT settings. If you run your Perforce Server on the default port of 1666 and set up a hostname of "perforce" as an alias for the machine running the server, users never need to set P4PORT. In that case, when you change the machine running the Perforce Server, you can update your name server so "perforce" refers to the new machine rather than the old. This will make the move completely transparent to your users.
