Installing A New License File
TASK
How do I install a new license file?
SOLUTION
When you add new users, or when the Perforce Server's IP address or port number changes, you need to install a new license file. To install a new license file, use one of the following three methods.
1. Install the File and Restart the Server
If the Perforce Server's IP address changes, or the port number in the license file changes, you must stop and restart the Perforce Server. If there are no changes to the IP address or port number in your license file, consider using one of the other license installation methods detailed below, because they do not involve stopping the server.
-
Stop the Perforce Server by issuing the following command:
p4 admin stop
- Replace the old license file in the server's root folder with the new license file. The file is named 'license'.
-
Restart the Perforce Server as follows:
- Windows: Go to the Services control panel (Start > Run, type 'services.msc' and hit enter), scroll to the Perforce server entry, then right click and select 'Start'.
- Linux/Unix: Run the Perforce startup script you usually use. If you do not have a Perforce startup script, cd to the Perforce Server root location ($P4ROOT) and issue the following command:
p4d -r . -d
- Windows: Go to the Services control panel (Start > Run, type 'services.msc' and hit enter), scroll to the Perforce server entry, then right click and select 'Start'.
2. Use the p4 license Command
First available in the 2006.2 Perforce Server, the p4 license command enables Perforce 'super' users to update or display the Perforce license file. This command requires a valid license file already in the Perforce server root directory.
p4 license -oTo install a new license:
cat license | p4 license -ior
p4 license -i < license
If you are using Perforce Server 2006.2 or later, and have direct access to the Perforce Server root (P4ROOT) directory, instead of using p4 license you can simply copy the new license file over the existing license file, and the server will read the new license information upon execution of the next server command.
Note:
The general use case for the p4 license command is adding new users without stopping the server. However, when the server IP address or port number has changed in the license file, the p4 license command will not work. In this case, you must stop and restart the server as detailed above.
3. Use the P4V Administration Tool
For server versions 2006.2 and later, you can use the Administration Tool in P4V (available in P4V 2008.1 and later), assuming the IP address or port number has not changed. To install your new licenses using P4V:
- Launch P4V (version 2008.1 and later) as a Perforce superuser.
- Choose Tools > Administration.
- On the Administration Home page, click on the "Load new license file" link and browse to the license file on your local disk.
After successful installation, the Administration tool Home page is updated with the new license information.
