p4 serverid

Get or set the unique ID associated with a Helix server.

Syntax conventions

p4 [g-opts] serverid [serverID]

Description

Important

We recommend that you use p4 serverid instead of P4NAME.

Unless a P4NAME value has been specified for the server, the server uses the serverid to determine the appropriate configuration settings. See p4 configure.

Important

To avoid configuration problems, the value of serverID should always match the value of P4NAME if both are set. We recommend setting serverID, but support P4NAME for backward compatibility.

p4 serverid retrieves or sets the unique ID of a Helix server by reading or writing the server.id file in the server’s root directory.

When you configure servers in a multi-server installation, assign to each server its own serverid and specify the server configuration for that serverid.

Use this command to create or update the server.id file after first generating a unique ID for the server with the p4 server command.

Important

The server.id file is in the server’s root directory, and this file must be backed up. If you are using the p4 server command to configure your servers, and one of your servers suffers a catastrophic data loss, any attempt to restart the restored server requires that the server.id file be present (or be re-created).

To reset the serverid

  1. Stop the server.
    For example:

    p4 admin stop
  2. Remove the existing server.id file.
    For example:

    cd your/server/root-directory
    rm server.id

  3. Start the server.
  4. Run the p4 serverid command to assign an ID to your server.

    p4 serverid yourNewNameForTheServer

  5. Adjust any configurables associated with the serverid.
    For example:

    p4 configure show allservers
    p4 configure set servername#monitor=2

  6. Adjust the fields of the server specification that depend on the serverid value, such as ReplicatingFrom:

Options

serverID

If supplied, update server.id with the unique ID of the server.

g-opts

See Global options.

Usage Notes

Can File Arguments Use Revision Specifier? Can File Arguments Use Revision Range? Minimal Access Level Required

N/A

N/A

list, or
super to set the server ID

Related Commands

To edit or view a server specification

p4 server

To list all known servers

p4 servers