RADE

Source Code Manager

Backup and Restore

Tools and methods for saving and repairing databases or user workspaces

Technical Article

Abstract

This article explains how to save SCM databases or workspace images and how to restore them after a crash.


Backup

Scope

The purpose of backups is to allow, in case of hardware breakdown or error of manipulation, to find the most recent possible state of data in the past. For that, data are copied out regularly on a media that is stored in a safe place.

In the worst of cases, after restoration, what was made by user since the last backup is lost. In addition, it is not possible to work during a backup or a restoration.

Some of these perturbations can be avoided by using replication mechanisms like RAID (Redundant Array of Inexpensive Disks). For more information, see RAID documentation . RAID-5 prevents from stopping databases due to one hard disk failures without loss of space and access time.

Anyway backups are needed to avoid to loose data in case of a general accident (fire, inundation, etc).

[Top]

Method

SCM commands register all modifications applied on objects inside workspaces. Those modifications are stored in different repositories split in relational database(s) and one or several SCM file servers. Any command operates in a transaction mode that ensures consistency between image's contents, database's contents and file servers' contents.

Any SCM command that performs changes (adl_co, adl_sync, ...) is composed of (at least) one transaction.

In theory, performing a backup at a given time should need

In concrete, saving databases and file servers' contents is a short operation (few minutes when incremental backups are used) and may often be performed at a time where SCM commands are not used (for instance during the night). Conversely, saving users' images is a long operation (and more there are users, more long this operation will be).

Due to the time needed for saving users' images, we advice to split the backup operation in two tasks:

When restoring images or repositories, this solution leads to check and restore the consistency of images against repositories' contents. This is explained in Repairing One Image's Contents..

[Top]

Backuping Repositories

Here are the steps to follow for backuping SCM repositories.

Step Action
Stop the monitor to forbid the use of SCM commands adl_mo_admin -stop
Stop all file servers (1) adl_fs_admin -host hostname -port port_number -stop
Save all databases For example for Oracle:
exp system/manager FULL=Y FILE=XXX (2)
Save all file server's data For a given file server:
save the directories specified when launching this file server using the -data and -files options (3).
Start all file servers telnet hostname -l adl
...
adl_file_server -port port_number
Start the monitor telnet hostname -l adl
...
adl_monitor -port port_number

(1) the list of file servers can be obtained by adl_ls_contents_server command)
(2) or any command for saving databases
(3) a fast method could be to first copy these directories on a local disk of  the directories specified using -data and -file options. This copy is very quick and can be done in incremental to only save modified files. For example, on Unix, use the commands find OriginDir -newer LastCopyFile -print | cpio -pdmu DestDir and  echo LastCopyFile. When the copy is achieved, the file servers and the monitor can be started again and the copies can be saved.

[Top]

Backuping Images

Users' file systems are saved regularly at different points of time and with different frequencies. Any usual tool can be used for that purpose.

Note: incremental backups can be used but they can lead (when restoring) for deleted files to reappear.

[Top]

Restoring Repositories

Here are the steps to follow for restoring SCM repositories.

Step Action
Stop the monitor adl_mo_admin -stop
Stop all file server's (1) adl_fs_admin -host hostname -port port_number -stop
Restore all file servers For a given file server:
restore the directories specified when launching this file server using the -data and -files options
Restore databases Use the database tools for analyzing and/or repairing the database.
For instance for Oracle:
imp system/manager FULL=Y FILE=xxx
Restart file servers telnet hostname -l adl
...
adl_file_server -port port_number
Restart the monitor telnet hostname -l adl
...
adl_monitor -port port_number
Restore users's images against databases' contents See Restoring Images.

(1) the list of file servers can be obtained by adl_ls_contents_server command)

Note: even if databases and File Server(s) can be saved at different points in time, it is important - when restoring - to choose a File Server's backup that is more recent than the database's backup to be used. Restoring a File Server's backup that is more recent will produce a consistent restoration, not the reverse!

[Top]

Restoring Images

SCM does not provide any tool dedicated neither to save nor to restore a user's file system. The process of restoring an SCM image consists in

  1. Restoring the image using an appropriate tool.
  2. Check its consistency against what is recorded in the associated repository by following the procedure described in Repairing One Image's Contents.

[Top]

Repairing

Repairing means restoring deleted or damaged data using data that are stored in another place (may be under another format).

Repairing File Server's Data

The directory containing information data for a File Server (the one specified by the -data option) can be rebuilt from the directory containing file versions (the one specified using the -files option).

To do that one must:

  1. Stop the File Server using the adl_fs_admin command.
  2. Start the File Server using -data, -file and -repair options.
    The File Server will repair data and stop.
  3. Restart the File Server (as usual).

[Top]

Repairing One Image's Contents

Here are some methods for repairing one workspace image when it seems it has been damaged.

Note: the adl_chk command can be used at any time for comparing one image's contents against what is managed in SCM repositories.

[Top]


In Short

SCM repositories (Oracle and File Server) must be saved as often as possible.

All repositories must be restored together and using a File Server's backup that is more recent than the database's backup.

Workspace Images can be restored from database contents using the adl_restore_image command and Images' contents can be checked using the adl_chk command.

[Top]


History

Version: 1 [Mar 2000] Document created
[Top]

Copyright © 2000, Dassault Systèmes. All rights reserved.