imrestore

imrestore is the utility used to restore messages from the backup device into the message store.


Syntax

 
imrestore [ -b blocking_factor ] [ -t 1|2|3 ] [ -i ] [ -f device | file |- ] \
[
-c continuation_filename ] [-l config_file_location] [ -u usernames_file | userlist ]
 

The following options are used with imrestore:

-b blocking_factor  

This option indicates the blocking factor; all actual reads on the device are performed by blocks of the size 512 x blocking factor. The default is 20. Note: This number needs to be the same blocking factor that was used for the backup.  

-f device | file | -  

Specify the file name or device from which the backup data is read. For example:

-f ./backup.0515

-f /dev/rmt/0  

-f -  

This option reads from standard in (stdin) to pipe the restore from another tool (not possible in interactive mode).  

-i  

Interactive mode (see the following section on interactive mode).  

-t 1 | 2 | 3  

Designates the type of restore to be performed:

  • 1=regular restore (default)-To help a user who accidentally expunged a folder to recover messages. The username should be specified on the command line. If the original folder exists, folders are restored using their names, followed by the date of the backup. For example, the folders will be in the form: mailbox.date. If mailbox.date already exists, imrestore uses mailbox.date.001, then mailbox.date.002, and so on.
  • 2=recover-To be used when the message store has been corrupted and was reinitialized. A recover should be done on the last full backup, plus every incremental backup since that full backup, in chronological order. Folders are restored to their original names whenever possible.
  • 3=migrate-Used to migrate users from one message store to another. The username needs to be specified on the command line.
  •  

    -c continuation_filename  

    Used when restoring from multiple backups that were made from the same message-store. Allows the restored messages' identifiers to be loaded from and saved to the specified file so that subsequent restores from continuation backups don't create multiple copies of identical messages.


    When this option is not used, an in-memory table is created for the lifetime of this restore session. This option should only be used for backups made on the same message-store when no full restore has occurred between backups. If in doubt, do not use this option.  

    -u usernames_file | userlist  

    Used only to restore or migrate users whose names are in the usernames_file or specified users (userlist). By default, all users on the back up tape are restored or migrated.  

    -l config_file_location  

    Location of Message Access Services configuration file (ims.cnf). If the -l option is not specified, the default location (/etc/opt/SUNWmail/ims/) will be used.  

    Interactive Mode

    imrestore -i works with an interface that accepts the following commands:

    B blkfactor  

    Set blocking factor (default: is 20)  

    L [ device | file ]  

    Open catalog or list files on device (this is the default)  

    O [ usernum | name ]  

    Open usernumber | username's backup file

    (if no argument is given, the current user is displayed)  

    C  

    Close current user file.  

    F [ foldername ]  

    View contents of foldername in current file  

    M [ folder | num ]  

    View message number (num) from folder (foldername).  

    T 1 | 2 | 3  

    Set restore options to:

  • 1 - Regular restore (undelete)
  • 2 - Recover (crash recovery)
  • 3 - Migrate users
  •  

    RM [ folder ] num  

    Restore message number, num, from folder name  

    RF [ folder ]  

    Restore folder  

    RU [ newusername ]  

    Restore user to newusername  

    RALL  

    The RALL command restores all users in the catalog according to the current type set by T.  

    ?  

    Help  

    The first thing to do in interactive mode is to open the back up device by using the L command with an argument, if none was specified with -f. This displays the list of users who were backed up on this tape, along with information about the actual back up date.

    For each user you want to restore, that user file must be opened with the command O [ username | name ]. The list of folders that exist for this user is displayed. It is now possible to:

    View the contents of a folder with the F command (this displays the header of each message present).
    View a particular message in a folder with the M command.
    Set the type of restore to 1, 2, or 3 (using the T option as defined in the preceding table).
    Restore or migrate a single message, folder, or the entire user information using the commands RM, RF, and RU, respectively.



    Copyright © 1999 Sun Microsystems, Inc. All Rights Reserved.