Perforce Public Knowledge Base - P4toDB and Upgrading your Helix Server
Downloads Blog Company Integrations Careers Contact Try Free
Menu Search
Reset Search



P4toDB and Upgrading your Helix Server

« Go Back


What changes are needed to my database tables for P4toDB to work with an upgrade to a new Helix Server version?

You see the error in P4toDB : The stored table version number in the SQL database does not match what the Perforce server is using;  how to I upgrade my database tables?

The currently supported method is to drop all tables and reload from a checkpoint.

Upgrading Without Starting Over

When the Helix server is upgraded, some schema changes may be necessary. 

The quickest way is to generate a new empty schema and compare the new to old:

  • Make a copy of your configuration file and change the TABLE_PREFIX within
  • Run "p4todb --init-and-quit --config-file <new-config-file>"
  • You will now have two schemas of tables and two rows in table P4TODB_CFG

Compare the values in the column P4TODB_CFG.TABLES between rows.  The TABLES column contains a "|" separated list of "<table> <version>" This will guide you to the tables you need to ALTER, create, or ignore.

Note that many tables do not change between releases.   If your TABLES column contains the same list of table "<version>" in both releases then no further changes are necessary.

If your config file uses DB_NO_REPL and the new TABLE is of no interest, simply add the table to DB_NO_REPL


  1. Compare the old table and new table definitions for the tables you replicate:  ALTER the database old table definition as required
  2. New tables may also be created or ignored.  To create, you can rename the new table (with the new TABLE_PREFIX) to use the original config file's TABLE_PREFIX. 
  3. Update the old P4TODB.TABLES column of your original replication row to have the new version numbers in your new row.
  4. Cleanup:  drop the new (unused) db objects and remove the new row from P4TODB_CFG

Restart replication with your original configuration file.

For understanding any new tables or column additions, see the Helix Server Schema Documentation.  The link is , where XY.Z is the Helix server version.   For example,

To view the new DDL., you can run:

p4todb.[bat|sh] --config-file <file> --print-ddl
Related Links



Was this article helpful?



Please tell us how we can make this article more useful.

Characters Remaining: 255