Полезная информация

Server Restore Procedures

Unarguably, the one thing that is more important than performing regular backups is having them available when it comes time to recover an important file!

Obviously, as discussed in the section called Server Backup Procedures, the procedures for performing a restore will differ depending on your choice of a backup solution. In this section, I will discuss methods for restoring files which have been backed up with ``tar'' and ''KDat''.

Restoring with ``tar'':

( Under construction )


Caution: Extracting files from a tar archive can be a dangerous thing to do, and should therefore be done with caution. Perhaps the files were not archived without a file path prepended, meaning they will all be extracted into the current directory (some, although only a few, developers still distribute tarballs of their software offerings like this. Grrr!) Perhaps the files were archived with leading ``/'' slashes (by specify the ``--absolute-paths'' option when the archive was created), meaning the files will be restored to their absolute locations (even if you didn't want them to be). Or, perhaps the files were archived without leading ``/'' slashes, meaning the files will be restored under the current directory (even if you didn't want them to be). For this reason, I strongly recommend testing your ``tar'' command with a ``t'' (type) option first, and then replace the ``t'' with an ``x'' (extract) when you are absolutely sure the command will do what you expect it to.

As mentioned in the section called Server Backup Procedures, when creating an archive file, tar will strip leading ``/'' (slash) characters from file path names. This means that restore files may not end up in the same locations they were backed up from. Therefore, either change to the ``/'' root directory, or use the ``--directory /'' option.


Note: A far safer solution is to restore the desired files under a different directory (for example, your home directory), and then compare, move, or update the files to their original locations afterward.

Restoring with ``KDat'':

To restore one or more files from a KDat-created backup set, insert the backup tape into the drive, choose “Mount Tape” from the “File” menu option (or left-click on the icon that looks like a tape).

KDat will try to read header information from the tape, and if successful, will then try to find the tape index which matches the identification found in the tape header. This tape index is stored on your hard drive, and is a unique file created for each backup tape formatted by KDat, and is updated each time you perform a backup.

If this corresponding tape index is missing (perhaps you are restoring from a backup set created on another machine, or the index file was deleted or somehow corrupted on your hard drive), KDat will inform you of this fact, and ask you if it is okay to recreate the index by reading the tape. Because you will need to recreate it before you will be able to restore your desired files, it makes perfect sense to left-click “Yes”.


(Note: Once a tape is reindexed, its name is changed to “Reindexed Tape”. You should rename the tape to its original name.)

Once the tape index has been successfully read, it can then used to select the directories or files you wish to restore from the backup set, in much the same manner you used when creating your backup profiles (see the section called Server Backup Procedures for detailed instructions on the file selection process).

Once you have selected the appropriate files, you can start the restoration process by choosing “Restore...” from the “File” option on the menu bar (or left-click the tape restore icon). KDat will display a dialog box, allowing you to confirm which files will be restored. In addition, you have the option of specifying a directory into which files will be restored. This will allow you to restore critical system files into your home directory, and then compare, move, or update those files to their intended location later on. This is actually the safest way of restoring files.

To begin the recovery process, click the “Okay” button. KDat will then scan the tape and restore the selected files.

On occasion, you may find it necessary or useful to restore one or more files from a backup set created with KDat without using KDat to do so. Perhaps you would like to restore such files on a system that does not offer a GUI-based environment, or would like to do so over a slow network connection through which remote execution of KDat would be impractical. Fortunately, KDat writes its backup data sets using the ``tar'' tool, a command-line based tool that is available on any *nix system.

Should you wish to restore your KDat-created backup set using tar, simply do so using whatever options you would with any normal backup set created with tar itself. Bear in mind, however, that data sets are not stored in compressed format.


Note: You will almost certainly get an error message when trying to access the KDat backup set with tar. This is because of the header and other information that KDat added to the tape when it was first formatted. Simply repeat the tar command two or three times to skip to the beginning of the actual tar archive file.