Upgrading a Perforce Server

Info & Tags

Article #:
46
Created:
05/03/07
Modified:
08/04/08
Tags:
p4d, upgrade

Links

TASK

How do I upgrade to a new version of the Perforce Server?

SOLUTION

To run a newer version of the Perforce Server, your Perforce license must be current. Expired licenses do not work with upgraded servers. (This is not a problem if you are running an unlicensed installation, which is limited to two users and two (2004.2 and earlier) or five (2005.1 and later) client workspaces. An unlicensed installation is sometimes used for evaluating Perforce.)

In general, you cannot downgrade a server. It is therefore imperative that you create a checkpoint prior to upgrading a server.

Assuming you have a good license (or are running an unlicensed two user/two or five client workspace installation), and you are upgrading from a recent release, Perforce Server upgrading can be as simple as performing the following steps:

  1. Stop the current p4d.
  2. Make a checkpoint of the database by issuing the following command, where "root" is the directory in which your db.* files are located:
  3. p4d -r root -jc
  4. Back up the versioned files.
  5. Download the new p4d executable.
  6. Install the new p4d in the desired location.
  7. Run the following command:
  8. p4d -xu -r root
  9. Restart p4d with your usual parameters.

See Supporting Perforce: Backup and Recovery in the Perforce System Administrator's Guide for information on making a checkpoint of the database and backing up the versioned files.

If you are upgrading the Perforce server from a release prior to 2001.1, there may be additional considerations. To ensure a successful upgrade from releases prior to 2001.1, please send an email to support@perforce.com.

Older Perforce client programs (p4, P4Win, and P4SCC) work with newer server versions with no trouble. Some features in a new server release require a client upgrade as well; users with older client programs cannot use the new server features.

Perforce's remote depot support requires all your Perforce Servers to be at or above Release 98.2. 2005.1 and later servers can be used as remote depots from only 99.2 and later servers.

Metadata database schema upgrades

Significant metadata database schema upgrades are performed by the p4d -xu command. The p4d -xu command is generally required when upgrading a server with 1000 or more changelists. If a server has fewer than 1000 changelists, it is automatically upgraded when the new server is started. Attempting to start a new server using a metadata database containing 1000 or more changelists, and for which significant schema upgrades are needed, results in the following server error:

Database is at old upgrade level x.  Use 'p4d -xu' to upgrade to level y

where x and y are server internal upgrade levels.

After writing the error, the server terminates. On Windows, error messages are written to the server log but are not displayed.

The p4d -xu command is not required for all server upgrades. For example, p4d -xu is not required when upgrading a 2005.2 server to 2006.1, regardless of the number of changelists. But this does not imply that a 2006.1 server can be downgraded to 2005.2 by simply starting a 2005.2 server using a metadata database previously used by a 2006.1 server. New servers make additional schema modifications in the metadata database as the new server executes.

Additional space required

For most upgrades, additional space is required for both the db.* files and the journal. The maximum additional space required for each of these during the p4d -xu is listed in the following tables. For most upgrades, the actual additional space used is less than what is listed in the tables, since what is listed is based upon a worst-case scenario.

Maximum additional space required during 2008.1 p4d -xu

Upgrading from
release
Maximum additional space
required for db.* files
Maximum additional space
required for journal
2007.3
0.5x size of db.rev
size of db.change
+ 0.5x size of db.rev
2007.2
1.5x size of db.rev
+ size of db.view
size of db.change
+ 1.5x size of db.rev
+ size of db.view
2006.2
1.5x size of db.rev
+ size of db.view
size of db.change
+ 1.5x size of db.rev
+ size of db.view
2006.1
1.5x size of db.rev
+ size of db.view
size of db.change
+ 1.5x size of db.rev
+ size of db.view
2005.2
1.5x size of db.rev
+ size of db.view
size of db.change
+ 1.5x size of db.rev
+ size of db.view
2005.1
3.5x size of db.rev
+ size of db.view
size of db.change
+ 4.5x size of db.rev
+ size of db.view
2004.2
5.5x size of db.rev
+ size of db.view
size of db.change
+ 6.5x size of db.rev
+ size of db.view

Maximum additional space required during 2007.3 p4d -xu

Upgrading from
release
Maximum additional space
required for db.* files
Maximum additional space
required for journal
2007.2
size of db.rev
+ size of db.view
size of db.rev
+ size of db.view
2006.2
size of db.rev
+ size of db.view
size of db.rev
+ size of db.view
2006.1
size of db.rev
+ size of db.view
size of db.rev
+ size of db.view
2005.2
size of db.rev
+ size of db.view
size of db.rev
+ size of db.view
2005.1
3x size of db.rev
+ size of db.view
4x size of db.rev
+ size of db.view
2004.2
5x size of db.rev
+ size of db.view
6x size of db.rev
+ size of db.view

Maximum additional space required during 2007.2 p4d -xu

Upgrading from
release
Maximum additional space
required for db.* files
Maximum additional space
required for journal
2006.2
0
0
2006.1
size of db.rev
size of db.rev
2005.2
size of db.rev
size of db.rev
2005.1
3x size of db.rev
+ size of db.view
4x size of db.rev
+ size of db.view
2004.2
5x size of db.rev
+ size of db.view
6x size of db.rev
+ size of db.view

Maximum additional space required during 2006.2 p4d -xu

Upgrading from
release
Maximum additional space
required for db.* files
Maximum additional space
required for journal
2006.1
size of db.rev
size of db.rev
2005.2
size of db.rev
size of db.rev
2005.1
3x size of db.rev
+ size of db.view
4x size of db.rev
+ size of db.view
2004.2
5x size of db.rev
+ size of db.view
6x size of db.rev
+ size of db.view

Maximum additional space required during 2006.1 p4d -xu

Upgrading from
release
Maximum additional space
required for db.* files
Maximum additional space
required for journal
2005.2
0
0
2005.1
2x size of db.rev
+ size of db.view
3x size of db.rev
+ size of db.view
2004.2
4x size of db.rev
+ size of db.view
5x size of db.rev
+ size of db.view

Maximum additional space required during 2005.2 p4d -xu

Upgrading from
release
Maximum additional space
required for db.* files
Maximum additional space
required for journal
2005.1
2x size of db.rev
+ size of db.view
3x size of db.rev
+ size of db.view
2004.2
4x size of db.rev
+ size of db.view
5x size of db.rev
+ size of db.view

Maximum additional space required during 2005.1 p4d -xu

Upgrading from
release
Maximum additional space
required for db.* files
Maximum additional space
required for journal
2004.2
2x size of db.rev
2x size of db.rev


If you are upgrading the Perforce server from a release prior to 2002.1, and you use jobs, you must run p4 jobs -R to reindex the jobs. The maximum additional space required for the db.* files during the p4 jobs -R is equal to the size of db.ixtext. The maximum additional space required for the journal during the p4 jobs -R is the sum of three times the size of db.ixtext, twice the size of db.boddate, twice the size of db.bodtext, and twice the size of db.ixdate.

To minimize the additional space required for the journal, disable journaling during the upgrade. Be sure to re-enable journaling and make a checkpoint immediately following the successful upgrade. For information on enabling and disabling journaling, see the "Journal files" section of Supporting Perforce: Backup and Recovery in the Perforce System Administrator's Guide.