Upgrade P4 Server

You can upgrade P4 Server to allow users to take advantage of features introduced in later releases. Earlier P4 applications should continue to work with newer versions of P4 Server.

The upgrade is a two-step process:

  1. Install a newer version of P4 Server. This involves replacing the existing P4D binary with the newer version.

  2. Manually update the server database. On startup, the server completes the schema upgrade. To learn more, see:

Both steps must complete successfully before the upgrade is complete.

Important changes in P4 Server 2026.1 and later

Upgrading to P4 Server 2026.1 or later increases the default security level (for example, to level 4). This can affect:

  • Authentication behavior

  • Password requirements

  • API clients and scripts

If you have scripts or integrations that rely on the previous authentication behavior, upgrading to a newer version of P4 Server might cause them to fail.

To learn more, see Important security update: Secure by default.

Before you upgrade

These steps help reduce the risk of data loss or upgrade failure. Ensure you complete the following:

  • Create a backup of the server, including a checkpoint and versioned files. To learn more, see Backup and recovery.

  • Ensure you have super access to the server.

  • Inform users of planned downtime.

  • Confirm your license is valid for the P4 Server version you are upgrading to. To learn more, see License statements.

  • Review the release notes for the version you are installing.

  • Linux only:

    • If you install P4 Server from Linux packages, ensure the Perforce package repository is configured. See Perforce Packages.

    • If you have an installation of the Git Connector, upgrade your Git Connector installation before upgrading your P4 Server. See Upgrade Git Connector.

Identify P4ROOT

You need the correct P4ROOT directory to run upgrade and recovery commands. Using the wrong location can result in upgrading or restoring the wrong server data.

To find P4ROOT:

  1. Run p4 info.

  2. Look for the line containing Server root and note the directory shown.

If you are managing your P4 Server using P4 Server Control (p4dctl):

  1. Run p4dctl list.

  2. In the list of services, look for root.

Take a checkpoint

A checkpoint is a backup of the server metadata. If an upgrade fails, the checkpoint is required to restore the server to a known good state.

To take a checkpoint, run:

p4d -r <P4ROOT> -jc

A file named checkpoint.<number> is created in P4ROOT.

Always create a checkpoint before upgrading. If the upgrade fails, the checkpoint is required to restore the server. To learn more, see Backup and recovery.

Confirm journaling is enabled

Journaling records all changes made to the server. This allows you to recover changes made after the last checkpoint if a failure occurs during the upgrade. If journaling is not enabled, you cannot recover changes made after the last checkpoint.

To check if journaling is enabled:

  1. Run p4 configure show.

  2. Look for P4JOURNAL=<value>.

    • If the value is set, journaling is enabled.

    • If the value is just a file name (for example, journal), it is stored in P4ROOT.

    • If a full file path is shown, that is the journal location.

Verify file integrity

Verifying files detects missing or corrupted data before the upgrade. Existing data issues can cause the upgrade to fail or result in data loss.

To verify file integrity, run:

p4 verify -q //...
p4 verify -qS //...

Ensure that no errors are reported. Missing or corrupted files must be resolved before continuing.

What to expect during an upgrade

The behavior of the upgrade depends on your P4 Server configuration. More details are provided when you Choose your upgrade path.

Single-server deployments

  • The server is stopped during the upgrade.

  • The server is unavailable until the upgrade completes.

  • Service is restored after the server restarts.

Multi-server environments

  • Servers must be upgraded in the correct order.

  • Some features might be unavailable during the upgrade.

  • Changes to the commit server affect all connected servers.

Upgrading from older versions

  • Some upgrades run background processes that continue after the server restarts.

  • Server performance might be reduced while upgrade processing completes.

  • Additional disk space might be required.

Lock a version of P4 Server during updates (Linux only)

It is possible for more than one P4 Server to run on the same Linux host. If the server has been installed using a package, and you want to prevent unintended upgrades to a higher version, consider pinning or locking the version. To learn more, see Hosts with multiple P4 Server instances.

After you upgrade

After completing the upgrade, ensure that all required upgrade steps are complete:

  1. Verify file integrity:

    p4 verify -q //...
    p4 verify -qS //...
    

    Ensure that no errors are reported. Missing or corrupted files must be resolved before continuing.

  2. Review the server log for errors or warnings. Ensure that the upgrade completed without failures. Investigate any reported issues.

  3. Confirm the upgrade level:

    p4 upgrades

    Ensure that all required upgrade steps are complete. No pending upgrades should be listed. The status of the upgrade steps is also shown in the log file. To learn more, see P4LOG.

The state.xu file

When you run p4d -xu to upgrade the database schema, the server writes a file named state.xu to P4ROOT. This file records the upgrade level applied by the current p4d binary.

The state.xu file is different from the state file. state.xu is an upgrade validation file, while state is a replication tracking file.

The server checks the state.xu file during startup to verify that the database schema matches the expected upgrade level for the running binary.

If p4d -xu has not been run after installing a newer p4d binary, the server refuses to start and reports that the database is at an older upgrade level. If the value in the state.xu file does not match the expected level, the server also refuses to start.

Do not delete the state.xu file. It is required for upgrade validation. If the file is missing or contains an incorrect value, run p4d -xu again using the correct p4d binary.

The state.xu file is created automatically by the upgrade process. You do not need to create it manually.

Choose your upgrade path

Choose an upgrade path based on your operating system: