29.4 Restoring the Embedded Sybase SQL Anywhere Database

The following sections provide information on restoring the backed-up embedded Sybase SQL Anywhere database:

IMPORTANT:If the database is located on a ZENworks Server, you must first restore the ZENworks Server, then restore the ZENworks database. Ensure that you have backed up the ZENworks Server and the database (at least once). You can also back up the ZENworks database on a regular basis. However, you can back up the server and the database in any order. For more information about backing up and restoring the ZENworks Server, see Section 32.0, Backing Up and Restoring the ZENworks Server and Certificate Authority.

29.4.1 Restoring the Embedded Sybase SQL Anywhere Database on a Windows Server

  1. Stop all the ZENworks Services on all the ZENworks Servers in the Management Zone.

    • On Windows: Do the following:

      1. Execute the following command at the server prompt:

        novell-zenworks-configure -c Start

      2. Enter the number next to the Stop action.

    • On Linux: Do the following:

      1. Execute the following command at the server prompt:

        /opt/novell/zenworks/bin/novell-zenworks-configure -c Start

      2. Enter the number next to the Stop action.

  2. At the Windows server prompt, go to ZENworks_Installation_directory:\novell\zenworks\bin, and enter the following command:

    ZenworksWindowsDBRestore.bat ZENworks_Installation_directory:\Novell\Zenworks\Database c:\dbBackup\zenworks_zone_name.db c:\dbBackup\zenworks_zone_name.log

  3. Press any key when the following message is displayed:

    Before proceeding, make sure you have backed up any files in:<Installation directory>:\Novell\ZENworks\database Press any key to continue.
    
  4. Enter Y when the following message is displayed:

    The following services are dependent on the Novell ZENworks Datastore service. Stopping the Novell ZENworks Datastore service will also stop these services: Novell ZENworks Loader, Novell ZENworks Agent Service, Novell ZENworks Server. Do you want to continue this operation? (Y/N) [N]:
    
  5. Press any key when the following message is displayed:

    The Novell ZENworks Datastore service was stopped successfully. Press any key to continue...
    
  6. Enter Yes when the following message is displayed:

    Overwrite <installation directory>:\Novell\ZENworks\database\zenworks_<zone_name>.db? (Yes/No/All)
    
  7. Enter Yes when the following message is displayed:

    Overwrite <installation directory>:\Novell\ZENworks\database\zenworks_<zone_name>.log? (Yes/No/All):
    

    The backupFile and the backupLogFile are copied to ZENworks_Installation_directory:\Novell\ZENworks\database, and the database is restored.

  8. (Conditional) If you restore the database to a location other than the one mentioned in the zenworks_installation_directory\novell\zenworks\database\conf\zenworks_database.conf file, manually edit zenworks_database.conf to specify the new location of the database.

  9. Start all the ZENworks Services on all the ZENworks Servers in the Management Zone.

    • On Windows: Do the following

      1. Execute the following command at the server prompt:

        novell-zenworks-configure -c Start

      2. Enter the number next to the Start action.

    • On Linux: Do the following:

      1. Execute the following command at the server prompt:

        /opt/novell/zenworks/bin/novell-zenworks-configure -c Start

      2. Enter the number next to the Start action.

29.4.2 Restoring the Embedded Sybase SQL Anywhere Database on a Linux Server

  1. Stop all the ZENworks Services on all the ZENworks Servers in the Management Zone.

    • On Windows: Do the following

      1. Execute the following command at the server prompt:

        novell-zenworks-configure -c Start

      2. Enter the number next to the Stop action.

    • On Linux: Do the following:

      1. Execute the following command at the server prompt:

        /opt/novell/zenworks/bin/novell-zenworks-configure -c Start

      2. Enter the number next to the Stop action.

  2. Log in to the ZENworks server as root.

  3. Change to /opt/novell/zenworks/bin, and enter the following command:

    ./ZenworksLinuxDBRestore.sh -F "/root/dbBackup/zenworks_zone_name.db"

  4. Enter Y when the following message is displayed:

    The backup database file will OVERWRITE the existing database. Is that OK? [y/n]
    
  5. Enter Y when the following message is displayed:

    The novell-zenloader needs to be stopped for the database restore to be performed. Would you like to proceed [y/n]?
    

    The backup file is copied to /var/opt/novell/zenworks/database, and the restore log file to /var/opt/novell/log/zenworks/dbrestore.log. The database is restored.

  6. Start all the ZENworks Services on all the ZENworks Servers in the Management Zone.

    • On Windows: Do the following

      1. Execute the following command at the server prompt:

        novell-zenworks-configure -c Start

      2. Enter the number next to the Start action.

    • On Linux: Do the following:

      1. Execute the following command at the server prompt:

        /opt/novell/zenworks/bin/novell-zenworks-configure -c Start

      2. Enter the number next to the Start action.