6.0 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. Ensure that you have archived your database credentials.

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

    1. Ensure that the database services are running.

      On Windows: In the Windows Services, ensure that the status of Novell ZENworks Embedded Datastore and Novell ZENworks Embedded Datastore For Auditing are Started.

      On Linux: At the console prompt,

      Enter /etc/init.d/sybase-asa status on SLES 11 or systemctl status sybase-asa.service on SLES 12 to verify the status of the Sybase database.

      Enter /etc/init.d/sybase-audit-asa status on SLES 11 or systemctl status sybase-audit-asa.service on SLES 12 to verify the status of the Audit database.

      If the databases are not running, start the

      Sybase database by running the:

      • /etc/init.d/sybase-asa start on SLES 11.

      • systemctl start sybase-asa.service on SLES 12.

      Audit database by running:

      • /etc/init.d/sybase-audit-asa start on SLES 11.

      • systemctl status sybase-audit-asa.service on SLES 12.

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

    3. Obtain the Audit database credentials by running the zman dgca command.

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

    5. Copy and save the user name and the password of the Sybase database and the Audit database into a text file.

  2. Stop the Novell ZENworks services, including the ZENworks Embedded Datastore service and the Novell ZENworks Embedded Datastore For Auditing service on PSDB1:

    1. 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.

    2. 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 the Novell ZENworks services on PSDB2:

    1. 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.

    2. 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 the following files on PSDB2 based on your operating system:

    For Windows:

    • sybase-asa-17.0.0.26419.x86_64.msi

    • novell-zenworks-sybase-libs-17.0.0.26419.x86_64.msi

    For Linux:

    • sybase-asa-17.0.0-26387.x86_64.rpm

    • novell-zenworks-sybase-libs-17.0.0-26387.x86_64.rpm

    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. Copy the following files from PSDB1 to the temporary location that you created on PSDB2 (Step 4.a).

      • For Windows:

        • sybase-asa-17.0.0.26419.x86_64.msi

        • novell-zenworks-sybase-libs-17.0.0.26419.x86_64.msi

        If PSDB1 is a Windows server:

        • The MSIs are located in the following directory:%ZENWORKS_HOME%\install\downloads\msi

        • The RPMs are located in the following directory:%ZENWORKS_HOME%\install\downloads\rpm

      • For Linux:

        • sybase-asa-17.0.0-26387.x86_64.rpm

        • novell-zenworks-sybase-libs-17.0.0-26387.x86_64.rpm

        If PSDB1 is a Linux server:

        • The MSIs are located in the following directory:

          \opt\novell\zenworks\install\downloads\msi\

        • The RPMs are located in the following directory:

          \opt\novell\zenworks\install\downloads\rpm

      Or

      Download the required Sybase SQL Anywhere Embedded EBF package to the temporary location that you created on PSDB2 (Step 4.a).

      • For Windows: Launch the shipped ISO file and extract the contents in the media drive. Download the Sybase SQL Anywhere Embedded EBF 3924 package from the msi folder as shown below:

        D:\Zenworks11SP4\Common\msi\sybase-asa-17.0.0.26419.x86_64.msi

      • For Linux: Mount the shipped ISO file to any location (for example: /tmp) using the following command:

        mount Zenworks11SP4 -o loop/tmp/ZCM

        From the media root (for example: /tmp/ZCM), download the Sybase SQL Anywhere Embedded EBF 3873 package from the rpm folder as shown below:

        /tmp/ZCM/Common/rpm/sybase-asa-17.0.0-26387.x86_64.rpm

  5. On PSDB2, install sybase-asa-17.0.0.26419.x86_64.msi or sybase-asa-17.0.0-26387.x86_64.rpm.

    • 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-17.0.0.26419.x86_64.msi TARGETDIR="%ZENWORKS_HOME%\share" ALLUSERS=2

      For example:

      msiexec /i c:\sybase-asa-17.0.0.26419.x86_64.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-17.0.0-26387.x86_64.rpm --force

      For example:

      rpm -Uvh /tmp/sybase/sybase-asa-17.0.0-26387.x86_64.rpm --force

    The Sybase database is now installed on PSDB2.

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

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

  7. On PSDB2, install novell-zenworks-sybase-libs-17.0.0.26419.x86_64.msi or novell-zenworks-sybase-libs-17.0.0-26387.x86_64.rpm.

    • 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-17.0.0.26419.x86_64.msi TARGETDIR="{Parent of the Novell\ZENworks directory structure}" ALLUSERS=2 REBOOT=ReallySuppress /l*v <complete_path_of_directory_that_contains_Sybase-libs_MSI>\novell-zenworks-sybase-libslog.txt

      For example:

      msiexec /i c:\sybase\novell-zenworks-sybase-libs-17.0.0.26419.x86_64.msi TARGETDIR="C:\Program Files (x86)" ALLUSERS=2 REBOOT=ReallySuppress /l*v c:\sybase\novell-zenworks-sybase-libslog.txt

    • 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-17.0.0-26387.x86_64.rpm --force

      For example:

      rpm -Uvh /tmp/sybase/novell-zenworks-sybase-libs-17.0.0-26387.x86_64.rpm --force

  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.zip from the Micro Focus Customer Center to a temporary location on PSDB2, then extract the contents of the ZIP file.

      The ZIP file contains the embedded_database.reg file and the embedded_audit_database.reg file.

    2. Open embedded_database.reg and embedded_audit_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. 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__

      • On PSDB2, ensure that the value of Parameters contain the correct path of zenworks_database.conf in the embedded_database.reg file and zenworks_audit_database.conf in the embedded_audit_database.reg file.

        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 the embedded_database.reg file and the embedded_audit_database.reg file.

    4. When you are prompted to add the content of the embedded_database.reg file and embedded_audit_database.reg file 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 dbsrv17.exe.

      For example:

      C:\Program Files (x86)\Novell\ZENworks\share\ASA\BIN64\dbsrv17.exe -hvSQLANYs_ZENDatastore

    6. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SQLANYs_ZENAuditDatastore and verify the ImagePath value to ensure it is pointing to dbsrv17.exe.

      For example:

      C:\Program Files (x86)\Novell\ZENworks\share\asa\Bin64\dbsrv17.exe -hvSQLANYs_ZENAuditDatastore

    7. After adding the registry, restart the device.

  9. If PSDB2 is a Windows Primary Server, perform either of the following options:

    • Option 1:

      1. 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.

      2. Change the password of the Novell ZENworks Embedded Datastore, Novell ZENworks Embedded Datastore For Auditing, Novell ZENworks Join Proxy, Novell ZENworks Loader, Novell ZENworks Preboot Policy Service, Novell ZENworks Preboot Service, Novell ZENworks Server, Novell ZENworks services Monitor, and CasaAuthTokenSvc services:

        1. On Services (Local), right-click the service, then select Properties.

        2. On the property page, click Log On > This account, then specify a Password.

        3. Click Apply, then OK.

    • Option 2:

      Change the Log On account of the Novell ZENworks Embedded Datastore, and Novell ZENworks Embedded Datastore For Auditing services:

      1. On Services (Local), right-click the service, then select Properties.

      2. On the property page, click Log On > Local System account > Allow service to interact with desktop.

      3. Click Apply, then OK.

  10. 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.

  11. Copy the zenworks_database.conf file and the zenworks_audit_database.conf file from PSDB1 to PSDB2. The zenworks_database.conf file and the zenworks_audit_database.conf file are 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.

  12. On PSDB2, ensure that zenworks_database.conf and zenworks_audit_database.conf contain the correct database path.

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

  13. On all the Primary Servers in the Management Zone, take a backup of the zdm.xml and zenaudit.xml files. Then, update the Server entry key (<entry key=<"Server">) in the zdm.xml and zenaudit.xml files with the correct address of PSDB2 (the new database server).

    NOTE:If the zdm.xml and zenaudit.xml files reside within the Primary Server that contains the new database server, then it is recommended that you update the local host address 127.0.0.1 as the Server entry key.

    These files are located in ZENworks_installation_path\conf\datamodel on a Windows Primary Server, and in /etc/opt/novell/zenworks/datamodel on a Linux Primary Server.

  14. On the PSDB2 Linux server, run the permissions.sh command in the /opt/novell/zenworks/bin directory.

  15. If PSDB1 is a Linux Primary Server:

    • Remove sybase-asa sybase-audit-asa entries in /etc/opt/novell/zenworks/monitor.conf.

    • Disable the Sybase database services:

      • SLES 11: chkconfig sybase-asa sybase-audit-asa off

      • SLES 12: systemctl disable sybase-asa sybase-audit-asa

  16. On the PSDB2 Linux server, run the following commands:

    • On SLES 11

      etc/int.d/sybase-asa start

      /etc/int.d/sybase-audit-asa start

    • On SLES 12

      systemctl enable sybase-asa.service

      systemctl enable sybase-audit-asa.service

  17. Reboot the PSDB2 server.

    On Windows, the database services might not be displayed until the reboot is performed.

  18. Start all the ZENworks services except Novell ZENworks Embedded Datastore and Novell ZENworks Embedded Datastore For Auditing on PSDB1:

    1. 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.

    2. 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.

  19. 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)+1 from zZENServerRoles where id=<0xNew DB servers GUID>)where Roles='Database'