15.4 Backing Up a View

When you back up and restore a view, the utility you use for the backup must maintain the original modification times and ownership of all files and directories in the view. If it does not, loaded files become hijacked. The ccopy utility (ccase-home-dir\etc\utils\ccopy) provides this capability. Although ccopy copies all the ownership information required by ClearCase LT, it does not copy the full security descriptor of an object. Use of ccopy has the side effect of granting the user who executes the command full access to the copied object. If you need to have all security descriptor information copied, use a copy utility that preserves this information (for example, the scopy command from the Windows NT Resource Kit).

Backing up views is less complicated, and in some ways less important, than backing up VOBs. If you already have a system in place that backs up files and directories on ClearCase LT client hosts, that system will also back up view directories located on those hosts. These directories contain the files that developers create and modify. If you need to recover one or more of these files from a backup, perhaps because a developer has inadvertently deleted something that was changed significantly since the last time it was checked in, you can usually do this in the same way that you recover any file from backup: simply recover the files to the view directory. The developer should be able to continue working on them and check them in when needed. If deleted file had been loaded into the view but not checked out, reloading the view recovers the file.

Any backup and recovery plan that includes the view storage directory (for example, a disaster recovery plan for the ClearCase LT server) must take pains to ensure that, for reach view, the view storage directory and the view directory are backed up at the same time. The view storage directory maintains detailed information about the checkin/checkout state of the files in the view directory; any skew between what the view storage directory records and the actual state of the view when both are restored will result in apparent anomalies such as files that appear to be hijacked and files that appear to be "checked out but removed."

When both the view and view storage directories reside on the ClearCase LT server, it is easier to ensure that both directories are backed up at the same time. When the directories are on different hosts (for example, the view directory is on a ClearCase LT client), you need to make sure that developers do not check in or check out files or directories while the backup is in progress.

To back up a view:

  1. Determine the location of the view storage directory. Use the ClearCase Administration Console or run lsview to display view storage information. If your backup program runs over the network, you need the Global path. If your backup program runs locally, you need the View server access path:

  2. C:\> cleartool lsview -long akp_vu
    Tag: akp_vu
    Global path: \\neptune\home\akp\views\akp.vws .
    ...
    Region: dvt
    ...
    View on host: neptune
    View server access path: /home/akp/views/akp.vwsc:\home\akp\views\akp.vws .
    ...

  3. Ensure self-consistency of the backup. To keep the view inactive while it is backed up, warn ClearCase LT users not to use it during the backup, or use the chview command to prevent users from updating the view database.

  4. cleartool chview -readonly akp_vu
    Properties: readonly

  5. Enter the backup commands. Back up the entire view directory tree. If the view storage directory is outside the view's directory tree, be sure to back up both the view directory tree and the view storage directory.

  6. If you made the view read-only in Step #2, make it writable.

  7. C:\ cleartool chview -readwrite akp_vu
    Properties: readwrite

  8. If you renamed the view storage directory in Step #2, rename it to its registered location.