29.5 Moving the Internal Sybase Database from One Primary Server to Another Primary Server

Assume that the Primary Server that currently hosts the internal Sybase database is called PSDB1. Assume that the Primary Server or the new device to which you want to move the internal Sybase database is called PSDB2.

  1. Make sure that you have archived your database credentials.

    To archive the credentials of an internal Sybase database, perform the following tasks on PSDB1:

    1. Make sure that the database service is running.

      On Windows: In the Windows Services, make sure that the status of Novell ZENworks Embedded Datastore is Started.

      On Linux: At the console prompt, enter /etc/init.d/sybase-asa status to verify the status of the database. If the database is not running, start the database service by running the /etc/init.d/sybase-asa start command.

    2. Obtain the Sybase database credentials by running the zman dgc command.

    3. Provide the credentials of the ZENworks administrator when prompted.

    4. Copy and save the database username and password in to a text file.

  2. Stop all the Novell ZENworks services, including the ZENworks Embedded Datastore service on PSDB1:

    • On Windows: Perform the following steps

      1. Execute the following command at the server prompt:

        novell-zenworks-configure -c Start

      2. Specify the number next to the Stop action, then press Enter.

    • On Linux: Perform the following steps:

      1. Execute the following command at the server prompt:

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

      2. Specify the number next to the Stop action, then press Enter.

  3. Stop all the Novell ZENworks services on PSDB2:

    • On Windows: Perform the following steps:

      1. Execute the following command at the server prompt:

        novell-zenworks-configure -c Start

      2. Specify the number next to the Stop action, then press Enter.

    • On Linux: Perform the following steps:

      1. Execute the following command at the server prompt:

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

      2. Specify the number next to the Stop action, then press Enter.

  4. Procure sybase-asa-12.0.0.2601.msi/rpm and novell-zenworks-sybase-libs-/rpm on PSDB2:

    1. Create a temporary directory named sybase in c: if PSDB2 is a Windows device, and in /tmp/ if PSDB2 is a Linux device.

    2. Perform one of the following steps:

      • Copy sybase-asa-12.0.0.2601.msi,novell-zenworks-sybase-libs-12.0.0.2601.msi and novell-zenworks-sybase-libs-12.0.0.2601.x86_64.msi for Windows and sybase-asa-12.0.0-2624.i586.rpm, novell-zenworks-sybase-libs-12.0.0-2624.i586.rpm and novell-zenworks-sybase-libs-12.0.0-2624.x86_64.rpm for Linux from PSDB1 to the temporary location that you created on PSDB2 (in Step 4.a). If PSDB1 is a Windows server, the MSIs are located in the ZENworks_installation_directory\novell\zenworks\install\ downloads\msi directory and the RPMS are located in the ZENworks_installation_directory\novell\zenworks\install\downloads\rpm directory. If PSDB1 is a Linux server, the MSIs are located in the \opt\novell\zenworks\install\downloads\msi\ directory and the RPMS are located in the \opt\novell\zenworks\install\downloads\rpms directory.

  5. Install sybase-asa-12.0.0.2601.msi/rpm on PSDB2:

    • On a Windows server: At the server prompt, execute the following command:

      msiexec /i <complete_path_of_directory_that_contains_Sybase_ASA_MSI>\sybase-asa-12.0.0.2601.msi TARGETDIR="%ZENWORKS_HOME%\share" ALLUSERS=2

      For example:

      msiexec /i c:\sybase\sybase-asa-12.0.0.2601.msi TARGETDIR="%ZENWORKS_HOME%\share" ALLUSERS=2

    • On a Linux server: At the server prompt, execute the following command:

      rpm -Uvh <complete_path_of_directory_that_contains_Sybase_ASA_MSI>/sybase-asa-12.0.0-2624.i586.rpm

      For example:

      rpm -Uvh /tmp/sybase/sybase-asa-12.0.0-2624.i586.rpm

    The Sybase database is now installed on PSDB2.

  6. On PSDB2, ensure that the installed EBF version is by running the dblocate utility.

    The dblocate utility is located in the %ZENWORKS_HOME%\share\ASA\win32 directory on a Windows database server and in the /opt/novell/zenworks/share/sybase/bin32s directory on a Linux database server.

  7. Install novell-zenworks-sybase-libs-.msi/rpm on PSDB2:

    • On a Windows server: At the server prompt, execute the following command:

      msiexec /i <complete_path_of_directory_that_contains_Sybase-libs_MSI>\novell-zenworks-sybase-libs-12.0.0.2601.msi TARGETDIR="{Parent of the Novell\ZENworks directory structure}" ALLUSERS=2 REBOOT=ReallySuppress

      For example:

      msiexec /i c:\sybase\novell-zenworks-sybase-libs-12.0.0.2601.msi TARGETDIR="{Parent of the Novell\ZENworks directory structure}" ALLUSERS=2 REBOOT=ReallySuppress

    • On a Linux server: At the server prompt, execute the following command:

      rpm -Uvh <complete_path_of_directory_that_contains_Sybase-libs_MSI>/novell-zenworks-sybase-libs-12.0.0-2624.i586.rpm

      For example:

      rpm -Uvh /tmp/sybase/novell-zenworks-sybase-libs-12.0.0-2624.i586.rpm

  8. (Conditional) If PSDB2 is a Windows Primary Server, import the registry keys that add the ZENworks Embedded Datastore service to PSDB2:

    1. Download embedded_datastore-edit_me_first_01MAR2011.zip from the Novell Downloads Web site to a temporary location on PSDB2, then extract the contents of the ZIP file.

      The ZIP file contains the embedded_database.reg file.

    2. Open embedded_database.reg in a text editor, then make the following changes:

      • Change the value of ObjectName to the local _z_ username that is created after you install ZENworks 10 Configuration Management SP3. By default, the value of ObjectName is .\\__z_10_2__.

        To find the local _z_ username, do one of the following:

        • At the command prompt, enter net user|find /i "__z".

        • Open the Windows Computer Management, then browse to System Tools > Local User and Groups > Users.

        For example, if the resultant value is __z_0_244__ Administrator ASPNET, the local _z_ username is __z_0_224__. The value of ObjectName in embedded_database.reg must be changed from__z_10_2__ to __z_0_224__. Ensure that the value is prepended with a period (.) and two backslashes (\\), such as .\\__z_0_224__

      • Ensure that the value of Parameters contains the correct path of zenworks_database.conf on PSDB2.

        IMPORTANT:In the value for Parameters, the double quote (") and the backslash \ characters must be escaped by placing a backslash in front. For example, if zenworks_database.conf is located in d:\novell\zenworks\conf\, the value of Parameters is "\"@d:\\Novell\\ZENworks\\conf\\zenworks_database.conf\""

    3. Double-click embedded_database.reg.

    4. When you are prompted to add the content of the embedded_database.reg to the registry, click Yes.

    5. Go to HKLM\SYSTEM\CurrentControlSet\services\SQLANYs_ZENDataStore and verify the ImagePath value to ensure it is pointing to dbsrv12.exe.

  9. (Conditional) If PSDB2 is a Windows Primary Server, change the password of the local _z_ user account.

    For more information about how to change the password of a user account, see the Microsoft Windows documentation.

  10. (Conditional) If PSDB 2 is a Linux Primary Server, change the password of the zenworks user account by using the following command:

    passwd zenworks

  11. Copy the database files from PSDB1 to PSDB2:

    1. Create a directory with the name database in %ZENWORKS_HOME% on Windows PSDB2, and in /var/opt/novell/zenworks/ on Linux PSDB2.

    2. Copy all the files from %ZENWORKS_HOME%\database\ on Windows PSDB1 to %ZENWORKS_HOME%\database\ on Windows PSDB2, and from /var/opt/novell/zenworks/database/ on Linux PSDB1 to /var/opt/novell/zenworks/database/ on Linux PSDB2.

  12. Copy zenworks_database.conf from PSDB1 to PSDB2. The zenworks_database.conf file is located in the %ZENWORKS_HOME%\conf\ directory on a Windows Primary Server, and in the /etc/opt/novell/zenworks/ directory on a Linux Primary Server.

  13. On PSDB2, ensure that zenworks_database.conf contains the correct database path.

    For example, /var/opt/novell/zenworks/database/zenworks_zone_name.db is the database path on a Linux device.

  14. On all the other Primary Servers in the Management Zone, update zdm.xml with the correct address of PSDB2 (the new database server). The zdm.xml file is located in ZENworks_installation_path\conf\datamodel on a Windows Primary Server, and in /etc/opt/novell/zenworks/datamodel on a Linux Primary Server.

  15. Start all the ZENworks Services on PSDB2 and PSDB1:

    • On Windows: Perform the following steps:

      1. Execute the following command at the server prompt:

        novell-zenworks-configure -c Start

      2. Specify the number next to the Start action, then press Enter.

    • On Linux: Perform the following steps:

      1. Execute the following command at the server prompt:

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

      2. Specify the number next to the Start action, then press Enter.

  16. Assign the database role to PSDB2 by running the following command in the DBISQL utility:

    update zZenServerRoles set id=<0xNew DB servers GUID>, position=(select max(position) from zZENServerRoles where id=<0xNew DB servers GUID>)+1 where Roles='Database'