Restoring to a different computer

You can back up data on one computer and restore the data on a different computer. Importing a restore is useful for disaster recovery or upgrading a database server. After you back up your data and move over the storage-manager objects, you can perform an imported restore. An imported restore involves copying files from the source to the target computer and performing the restore in one of several ways.

Before you begin

Prerequisites:
  • Your storage manager must support imported restores.
  • A whole-system backup must include all storage spaces; logical logs are optional.

    The level-0 backup must include all storage spaces and logical logs.

  • Both the source and target computers must be on the same LAN or WAN and must have the following attributes:
    • Identical hardware and operating systems
    • Identical database server versions and editions
    • The same configuration and ROOTPATH information, although the server names and numbers can differ.
    • Identical storage-manager versions
    • Compatible XBSA libraries

About this task

Important: Every chunk (including mirrors) must match exactly in size, location, and offset on the source and target computers for the imported restore to complete.

Procedure

To perform the imported restore:
  1. Install the database server and the storage manager on the target computer.
  2. Set up the storage manager on the target database server instance.
    1. Set the necessary environment variables.
    2. Define the same type of storage devices as on the source instance.
    3. Label the storage media with the correct pool names.
    4. Mount the storage devices.
    5. Update the sm_versions file on the target computer with the storage-manager version.
  3. Be sure that the target computer has the devices and links in place for the chunks that match the devices and links on the source computer
  4. Perform a level-0 backup (onbar -b or onbar -b -w) of all storage spaces on the source database server.
    Restriction: Do not perform an incremental backup.
  5. If you are using HCL® OneDB® Storage Manager , follow these steps:
    1. Shut down the storage manager on both computers.
    2. Create a tar file of the storage-manager directories on the source computer.
    3. Copy this tar file and unpack it on the target computer.
    With other storage managers, you might be able to use backup tapes or import the storage-manager directories over the network. For more information, see your storage-manager documentation.
  6. Mount the transferred storage volumes.
    • If the backup files are on disk, copy them from the source computer to the target computer.
    • If the backup is on tapes, mount the transferred volumes on the storage devices that are attached to the target computer. Both the source and target computers must use the same type of storage devices such as 8-mm tape or disk.
    • If the backup is on the backup server, retrieve the backup from that backup server.
  7. Use storage-manager commands to add the source host name as a client on the target computer.
  8. Copy the following files from the source computer to the target computer.
    Table 1. Administrative files to copy
    File Action
    Emergency boot file Rename the emergency boot file with the target database server number. For example, rename ixbar.51 to ixbar.52. The emergency boot file needs only the entries from the level-0 backup on the source computer.

    The file name is ixbar.servernum.

    The oncfg files: oncfg_servername.servernum ON-Bar needs the oncfg file to know what dbspaces to retrieve. Rename the oncfg file with the target database server name and number. For example, rename oncfg_bostonserver.51 to oncfg_chicagoserver.52. The file name must match the DBSERVERNAME and SERVERNUM on the target computer.
    The onconfig file In the onconfig file, update the DBSERVERNAME and SERVERNUM parameters with the target database server name and number.
    Storage-manager configuration files, if any The storage-manager configuration files might need updating.
  9. Restore the data in one of the following ways:
    Table 2. Restore data options

    Option Action
    If you did not start the HCL OneDB instance on the target server Use the onbar -r command to restore the data.
    If you are importing a whole-system backup Use the onbar -r -w -p command to restore the data.
    If you started the HCL OneDB instance on the target server. Restore the data in stages:
    1. Use the onbar -r -p command to restore the physical data.
    2. Use the onbar -r -l command to restore the logical logs.

    This process avoids salvaging the logs and any potential corruption of the instance.

  10. Before you expire objects on the target computer and the storage manager with the onsmsync utility, perform one of the following tasks.
    Otherwise, onsmsync expires the incorrect objects.
    • Manually edit the emergency boot file viz ixbar.servernum in the $INFORMIXDIR/etc directory on the target computer. Replace the HCL OneDB server name that is used on the source computer with the HCL OneDB server name of the target computer
    • Run the onsmsync -b command as user informix on the target computer to regenerate the emergency boot file from the sysutils database only. The regenerated emergency boot file reflects the server name of the target computer.