Integration

Migrating from Linux to Windows

This article provides a step-by-step guide to migrating an OvalEdge application from a Linux (Ubuntu) server to a Windows server. The migration process involves backing up application files, databases, and configurations from the Linux environment and restoring them on Windows.

The key steps covered in this document include:

  • Backing up WAR, JAR, and configuration files from Linux
  • Installing and configuring MySQL on Windows
  • Restoring the database dump
  • Setting up Java, Elasticsearch, and Tomcat on Windows
  • Configuring and starting services to ensure smooth operation

Step 1: Backup Files from Ubuntu 

  1. Backup War File
    Copy the WAR file from the Tomcat directory.
  2. Backup JAR and Other Application Files
    Identify and save all JAR files used by the application.
  3. Backup Configuration Files
    Save important configuration files such as server.xml, web.xml, and .properties files.
  4. Backup DataBase Dump

mysqldump -u <UserName> -p ovaledgedb > /home/ovaledge/ovaledgedb.sql

  • Move all backup files to Windows server.

Step 2: Install MySQL on Windows

  1. Download & Install MySQL 8.0.41
    1. Get the installer from the official MySQL website.
    2. Run the installer and select MySQL Server 8.0.41.
    3. Choose either Server Only or Full Installation during setup.
    4. Check the MySQL Server and click the Next button.
    5. Select the MySQL Server 8.0.4.1 and click on Execute button.
    6. Check the MySQL Server 8.0.4.1 and click on Next button.
    7. Select the Type and Networking and check the TCP/IP and click on Next button.
    8. Set the root password and create a new MySQL user.
    9. Start MySQL and verify the installation by running:

      mysql -u root -p

      Show databases;

  2. Create the Database and User
    1. Run these SQL commands to set up the database and user:

      CREATE DATABASE ovaledgedb CHARACTER SET utf8mb4 COLLATE          utf8mb4_unicode_ci;

      CREATE USER 'ovaledge'@'localhost' IDENTIFIED BY '0valEdge!';

      CREATE USER 'ovaledge'@'%' IDENTIFIED BY '0valEdge!';

      GRANT ALL ON ovaledgedb.* TO 'ovaledge'@'localhost';

      GRANT ALL ON ovaledgedb.* TO 'ovaledge'@'%';

  3. Verify Database Creation
    1. Run the following command to check if the database was created successfully:
      SHOW DATABASES;
  4. Restore the Database Dump
    1. Select the newly created database:
      USE ovaledgedb;
  5. Import the backup file:

SOURCE /<Database Backup file path>/ovaledgedb.sql;

Step 3: Install Java on Windows

  • In your Virtual Machine (VM), download the Java 1.8 installation file from the official Java link.
  • Check the terms in the License Agreement and click on the Next button.
  • Select the location and then click on the Next button.
  • Click Install button to begin the installation. 

  • Edit the Variable value and click on the OK button.

Step 4: Install Elasticsearch

  1. Download and Extract
    1. Download the Elasticsearch 8.0.0 installer for Windows from the official Elastic Search link.
    2. Extract the contents to a directory on the Windows Server (e.g., C:\ovaledge\elasticsearch-8.14.3-windows-x86_64\elasticsearch-8.14.3).
    3. Open Command Prompt as an administrator and go to the Elasticsearch bin directory.
    4. For example, navigate to: 
      C:\ovaledge\elasticsearch-8.14.3-windows-x86_64\elasticsearch-8.14.3\bin
  2. Expose Elasticsearch as a Service
    1. Run the following command to install Elasticsearch as a Windows service:
      elasticsearch-service.bat install 

  3. Configure Heap Size for Elasticsearch
    1. To optimize performance, set the Elasticsearch heap size using these JVM settings:
      -Xms5g -Xmx5g 
      Steps:
      1. Go to the Elasticsearch installation folder (conf).
      2. Copy the jvm.options file and place it in the jvm.options.d folder.
      3. Open the jvm.options file in the jvm.options.d folder.
      4. Find the -Xms and -Xmx values. If they are commented out, uncomment them and change the values to:

        Xms8g  

        -Xmx8g 

  4. Configure Elasticsearch
    1. Open the elasticsearch.yml configuration file in a text editor. It is located at:
      C:\ovaledge\elasticsearch-8.14.3-windows-x86_64\elasticsearch-8.14.3\config\elasticsearch.yml  
    2. Add the following configuration settings:
      cluster.name: ovaledge  
      network.host: 0.0.0.0  
      transport.host: 127.0.0.1  
      http.host: 0.0.0.0  
      xpack.security.enabled: true 
    3. Save and close the file.

  5. Start Elasticsearch as a Service
    1. Open a command prompt as an administrator.
    2. Navigate to the Elasticsearch bin directory:
      cd C:\Program Files\elasticsearch-8.0.0-windows-x86_64\elasticsearch-8.0.0\bin
    3. Start the Elasticsearch service:
      net start elasticsearch-service-x64 
  6. Enable Authentication
    1. Go to the bin folder.
    2. Open the command prompt and run:
      elasticsearch-setup-passwords.bat interactive

       

    3. Set and confirm a password for the elastic user.
    4. Use the same password for all prompted users and store it securely.
  7. Restart Elasticsearch and Integrate with OE Applications
    1. After setting up authentication, restart Elasticsearch and connect it to OE applications.

      Step 5: Install Tomcat on Windows

      1. Download and Install Tomcat 9.0.102
        1. Download Tomcat from the official Apache Tomcat website.
        2. Extract the downloaded ZIP file.
        3. Place the backup ovaledge.war file in the Tomcat webapps folder.
      2. Install Tomcat as a Service Manually
        1. Open Command Prompt as an administrator.
        2. Navigate to the Tomcat bin directory.
        3. Run the service.bat script to install Tomcat as a service.
      3. Configure Tomcat
        1. Create a third_party_jars folder and add the backup JAR files.
        2. Create an Ext-prop folder and add log4j.properties and oasis.properties files.
        3. In oasis.properties, enter the database and Elasticsearch details.
        4. In the Tomcat9.w file, add the following extprop folder path:

          -Dext.properties.dir=file:C:\ovaledge\extprop\  
          -Duse.http=true  
          -Ddep-type=localhelp  
          -DOVALEDGE_SECURITY_TYPE=oauth2  
          -Dlog4j.configuration=file:C:\ovaledge\extprop\log4j.properties

           

      4. Start Tomcat and Verify
        1. Start Tomcat as a service.
        2. Check the logs in the Tomcat logs folder to confirm that Tomcat is running successfully.

        Conclusion

        By following these instructions, users can successfully transition their OvalEdge setup to a Windows-based environment while maintaining application stability and performance.