Perforce Public Knowledge Base - Example Windows Installation
Perforce Software logo
Reset Search
 

 

Article

Example Windows Installation

« Go Back

Information

 
Problem

When installing a new Perforce server under the Windows OS, the locations of installed files and settings can be customized.

Solution

This guide describes the installation and configuration of a Perforce server using the Windows installer, and how to customize Perforce file locations.

Note: We recommend reviewing the Windows installation section of the Perforce System Administrator's Guide before proceeding.

  1. Download the Perforce server software for the Windows OS used to host the Perforce service:

    Perforce Server installer for Windows 32-bit
    Perforce Server installer for Windows 64-bit
  2. Install the Perforce server using the downloaded installer binary. When prompted set the Port Number (P4PORT) to the port number for the Perforce service. If a license file (obtained from Perforce) is being used, use the port number specified there.

    Note: The default Perforce server port is 1666. If there is no license and a port has yet to be specified, use this port number.

  3. Decide where to locate the Perforce database (db.*) files, depot files and journal.

    Note: If no locations are specified, all files are installed in the Perforce server root directory (P4ROOT) as specified at installation. The database files are always located in P4ROOT.

    Note: For best performance the database files should be located on a fast, directly attached local disk. This should be a different disk than the versioned (depot) files.

    It's also important that the running journal is stored on a different physical disk than the database files, also preferably a fast, directly attached drive.

    For more information see Planning Your Perforce Server Installation.

  4. The installer automatically starts the Perforce service. Stop the Perforce service by:

    1. Open the Windows service control panel.
    2. Right click on the 'Perforce' service, and selecting the "Stop" menu item.
       
  5. Create a directory to contain the Perforce database in the desired location. For example:

    mkdir C:\perforce\
  6. Set the Perforce service variable to use this location for your Perforce server root directory:

    p4 set -S Perforce P4ROOT=<full path to 'db.*' files> 
    

    For example:

    p4 set -S Perforce C:\perforce\
    
  7. Create a dirctory to hold the Perforce "journal" file. For example:

    mkdir D:\perforce_jnl\
  8. Set the Perforce service variable to use this location for your Perforce server journal file:

    p4 set -S Perforce P4JOURNAL=<full path and name of journal>

    For example:

    p4 set -S Perforce P4JOURNAL=D:\perforce_jnl\journal 
    

    Note: The full path in this case includes the file name for the journal.

  9. (optional) Set the Perforce service variable to use this location for your Perforce server log file:

    p4 set -S Perforce P4LOG=<full path and name of log file>

    For example:

    p4 set -S Perforce P4LOG=D:\logs\p4_log 
    

    Note: The full path in this case includes the file name for the log.

  10. Put the Perforce license file, if any, into the P4ROOT directory.

  11. Start the Perforce service by:

    1. Open the Windows service control panel.
    2. Right click on the 'Perforce' service, and selecting the "Start" menu item.
       

    Note: If a start error is displayed, check the last entry in the Perforce log file (this defaults to the Perforce server root directory). The message there will explain what the issue is. Common errors are typically license or network based.

  12. Set the Perforce P4PORT and P4USER variables for the Perforce server port and super user who will be administering this installation:

    p4 set P4PORT={host:port}
    p4 set P4USER={super user}
  13. Initialize the Perforce protections table by entering the command:

    p4 protect

    This will open a default set of Perforce protections in your default editor. Save the form and quit the editor.

    Note: Once installation of the Perforce server is completed review the protections table either using the p4 protect command or using the P4Admin GUI application. Refer to the Protections chapter of the Perforce System Administrator's Guide for more information.

  14. Create your first Perforce user using the following command from a command prompt on the server:

    p4 user -f {user_name}
    

    For example:

    p4 user -f joe_dev 
  15. To locate the versioned files to a location other than the default:

    1. Create a directory to locate the depot folders. For example:

      mkdir F:\perforce_depots\
    2. Edit the depot specification to mapfiles to the new location using the p4 depot command:

      p4 -p localhost:<Port Number> -u <User-name> depot <depotname> 

      For example, to edit the default depot, named "depot":

      p4 depot depot

      This will open the specification for the depot.

    3. Change the 'Map:' field to point to the new location.  For example:

      Map: F:\perforce_depots\depot\... 

      Note: The sub-directory (depot) does not need to exist.

    4. Save the depot specification and exit.

The Perforce server is now ready to be used. The next step is to install a Perforce client application, P4V, as illustrated in the "Installing Perforce" section of our 10 minute test drive.

Note: To avoid potential security issues, always set passwords for Perforce users or increase the security level of the server to force users to create a password when they first log in. Please see Basic Perforce Administration chapter in the Perforce System Administrator's Guide for more information.

Related Links

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255