p4 renameuser


Rename a user and modify all database records that mention the user.


p4 [g-opts] renameuser --from=old --to=new


The p4 renameuser command renames a user and modifies the following elements to reflect this change:

  • the user record

  • groups that include the user

  • properties that apply to the user

  • objects owned by the user: workspaces, labels, branches, streams, and so forth

  • objects created by the user: all pending, shelved, and committed changes

  • files the user has opened or shelved

  • fixes the user made to jobs

The user name is not changed in descriptive text fields (such as job descriptions or change descriptions). It is only changed where the name appears as the owner or user field of the database record.

Protection table entries that apply to the user are updated only if the Name field exactly matches the user name. If the Name field contains wildcards, it is not modified.

The only job field that is processed is attribute code 103. If you have included the user name in other job fields, they will need to be changed manually.

The p4 renameuser command does not modify anything in the spec depot.

Usage and Limitations

For best results, follow these guidelines:

  • Before you use this command, check to see that the user name you want to specify for new does not already exist. Using an existing name might result in the merging of data for the existing and the renamed user despite the best efforts of the system to prevent such merges.

  • The user issuing this command should not be the user being renamed.

  • The user being renamed should not be using the server when this command executes. After the command completes, the user should log out and then log back in.

  • The p4 renameuser command does not process unloaded workspaces: all the user's workspaces should be reloaded (or deleted) first.

    A distributed installation might contain local workspaces or local labels owned by the user; these workspaces and labels, which are bound to Edge Servers, should be deleted or moved to the Commit Server first.

  • Files of type +k which contain the $Author$ tag that were submitted by the user will have incorrect digests following this command. Use p4 verify -v to recompute the digest value after the rename.



The name of the old user.


The name of the new user.


See the “Global Options” section.

Usage Notes

Can File Arguments Use Revision Specifier?

Can File Arguments Use Revision Range?

Minimal Access Level Required




Related Commands

To recompute digest values after the rename for certain files.

p4 verify

To create a user or manage user preferences.

p4 user

To list existing users.

p4 users