p4 admin

Synopsis

Perform administrative operations on the server.

Syntax

p4 [g-opts] admin checkpoint [-z | -Z] [prefix]
p4 [g-opts] admin journal [-z] [prefix]
p4 [g-opts] admin stop
p4 [g-opts] admin restart
p4 [g-opts] admin updatespecdepot [-a | -s type]
p4 [g-opts] admin resetpassword -a | -u user
p4 [g-opts] admin setldapusers

Description

The p4 admin command allows Perforce superusers to perform administrative tasks even when working from a different machine than the one running the shared Perforce service.

To stop the Perforce service, use p4 admin stop. This locks the database to ensure that it is in a consistent state upon restart, and then shuts down the Perforce background process.

To restart the service, use p4 admin restart. The database is locked, the service restarts, and any p4 configure settings that require a restart are then applied.

To take a checkpoint, use p4 admin checkpoint [prefix]. This is equivalent to logging in to the server machine and taking a checkpoint with p4d -jc [prefix]. A checkpoint is taken and the journal is copied to a numbered file. If a prefix is specified, the files are named prefix.ckp.n or prefix.jnl.n-1 respectively, where n is a sequence number. The MD5 checksum of the checkpoint is written to a separate file, checkpoint.n.md5, and the lastCheckpointAction counter is updated to reflect successful completion.

Note

You must be connected to the server to issue the p4 admin checkpoint command.

You can store checkpoints and journals in the directory of your choice by specifying the directory as part of the prefix. (Rotated journals are stored in the P4ROOT directory, regardless of the directory in which the current journal is stored.) If no prefix is specified, the default filenames checkpoint.n and journal.n-1 are used.

The p4 admin journal command is equivalent to p4d -jj. For details, see the Helix Versioning Engine Administrator Guide: Fundamentals. The files are created in the server root specified when the Perforce service was started.

The p4 admin updatespecdepot command causes the Perforce service to archive stored forms (specifically, client, depot, branch, label, typemap, group, user, and job forms) into the spec depot. If the -a option is used, all of the form specification types are archived. If the -s option option is used, then only those of the specified type are archived. Only those forms that have not yet been archived are created.

The p4 admin resetpassword command forces specified users with existing passwords to change their passwords before they can run another command. (This command works only for users whose authMethod is set to perforce. However, you can use it in a mixed environment, that is an environment in which both Perforce-based and LDAP-based authentication are enabled.)

  • To force password reset of all users with passwords (including the superuser who issued the command), use p4 admin resetpassword -a.
  • To force a single users to reset their password, use p4 admin resetpassword -u user.

The p4 admin setldapusers command allows you to convert all existing non-super users to use LDAP authentication. The command changes the AuthMethod field in the user specification for each user from perforce to ldap. If super users want to use LDAP authentication, they must set their AuthMethod manually.

Options

-a

For p4 admin updatespecdepot, update the spec depot with all current forms.

-s type

For p4 admin updatespecdepot, update the spec depot with forms of the specified type, where type is one of client, depot, branch, label, typemap, group, user, job, stream, triggers, protect, server, license, jobspec.

-z

For p4 admin checkpoint and p4 admin journal, save the checkpoint and saved journal file in compressed (gzip) format, appending the .gz suffix to the files.

-Z

For p4 admin checkpoint and p4 admin journal, save the checkpoint in compressed (gzip) format, appending the .gz suffix to the file, but leave the journal uncompressed for use by replica servers.

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

super

  • The p4 admin updatespecdepot and p4 admin resetpassword commands require super access. The others require that the user be an operator (see p4 user) or have super access.
  • To require all newly-created users with passwords to reset their passwords before invoking their first command, set the dm.user.resetpassword configurable:

    p4 configure set dm.user.resetpassword=1

    Running p4 admin resetpassword -a resets only the passwords of users who presently exist (and who have passwords).

  • Because p4 admin stop shuts down the Perforce service, you may see an error message indicating that the connection was closed unexpectedly. You can ignore this message.
  • The spec depot must exist before running p4 admin updatespecdepot.
  • p4 dbstat, p4 lockstat, and p4 logstat are standalone commands; the old p4 admin syntax remains as an alias for backward compatibility.
  • For more about administering Perforce, see the Helix Versioning Engine Administrator Guide: Fundamentals and Helix Versioning Engine Administrator Guide: Multi-site Deployment.

Examples

p4 admin stop

Stop the shared Perforce service

p4 admin checkpoint

Create a checkpoint named checkpoint.n, and start a new journal named journal, copying the old journal file to journal.n-1, where n is a sequence number.

p4 admin checkpoint name

Create a checkpoint named name.ckp.n, and start a new journal named journal, copying the old journal file to name.jnl.n-1, where n is a sequence number.

Related Commands

To see the status of the last checkpoint

p4 counter lastCheckpointAction