Moving from Windows to Linux, Retaining Case-handling

Info & Tags

Article #:
516
Created:
06/09/06
Modified:
10/09/08
Tags:
2004.2, 2005.2, 2006.1, case, p4d

Related Articles

Links

WARNING:

If you choose to use the -Cn flag, you must ALWAYS use this flag. This is necessary both when starting your Perforce Server and when running checkpointing operations. If you do not do so, you risk corrupting your Perforce database and/or your checkpoint and journal.

SUMMARY

This article describes the steps needed to move a Perforce Server from a Windows platform to a Linux platform, but retain Windows' case-handling behavior. Before proceeding, it is recommended that you read Using the server flag -Cn.


DETAILS

To transfer your Perforce Server installation from Windows to Linux but retain the case-handling behaviour, you need to take a checkpoint of the original database, transfer your archived files to the new platform, and rebuild the database from the new checkpoint using the -C1 flag.

  1. Stop the Perforce Server on your Windows machine;
  2. Take a checkpoint:
  3. p4d -r $P4ROOT -jc myCheckpoint
    Checkpointing to myCheckpoint.ckp.66...
    Saving journal to myCheckpoint.jnl.65...
    Truncating journal...
  4. Copy the checkpoint to the Linux machine's P4ROOT directory;
  5. Rebuild your database from the checkpoint, being sure to include the -C1 flag:
  6. p4d -r $P4ROOT -C1 -jr myCheckpoint.ckp.66
    Perforce db files in '$P4ROOT' will be created if missing...
    Recovering from myCheckpoint.ckp.66...
  7. Copy the archive files to the appropriate locations on your Linux machine, converting line-endings where appropriate.
  8. Start the Perforce Server, making sure you include the -C1 flag:
  9. p4d -r $P4ROOT -p 1666 -C1
At this point, you can run p4 verify -q //... to verify the integrity of the archive files.

As noted in the warning above, once you use the -Cn flag, you must always use it thereafter. You can maintain use of the flag by creating a wrapper for the Perforce Server, p4d. For example, creating a script similar to the one detailed below, specifying the path to your p4d executable:

#!/bin/sh
P4D=/path/to/real/p4d
exec $P4D -C1 "$@"
Name this script "p4d" and include it in the search path. Ensure that the real p4d executable is NOT included in the path. These two steps ensure that each time you run p4d, this script is launched rather than the actual executable. The -C1 flag is included automatically, and all additional parameters are passed to the p4d executable.

Please note: use of -C1 is undocumented, and is subject to change or removal without prior notice.