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
- Backup War File
Copy the WAR file from the Tomcat directory. - Backup JAR and Other Application Files
Identify and save all JAR files used by the application. - Backup Configuration Files
Save important configuration files such as server.xml, web.xml, and .properties files. - 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
- Download & Install MySQL 8.0.41
- Get the installer from the official MySQL website.
- Run the installer and select MySQL Server 8.0.41.
- Choose either Server Only or Full Installation during setup.
- Check the MySQL Server and click the Next button.
- Select the MySQL Server 8.0.4.1 and click on Execute button.
- Check the MySQL Server 8.0.4.1 and click on Next button.
- Select the Type and Networking and check the TCP/IP and click on Next button.
- Set the root password and create a new MySQL user.
- Start MySQL and verify the installation by running:
mysql -u root -p
Show databases;
- Create the Database and User
- 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'@'%';
- Run these SQL commands to set up the database and user:
- Verify Database Creation
- Run the following command to check if the database was created successfully:
SHOW DATABASES;
- Run the following command to check if the database was created successfully:
- Restore the Database Dump
- Select the newly created database:
USE ovaledgedb;
- Select the newly created database:
- 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
- Download and Extract
- Download the Elasticsearch 8.0.0 installer for Windows from the official Elastic Search link.
- 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).
- Open Command Prompt as an administrator and go to the Elasticsearch bin directory.
- For example, navigate to:
C:\ovaledge\elasticsearch-8.14.3-windows-x86_64\elasticsearch-8.14.3\bin
- Download the Elasticsearch 8.0.0 installer for Windows from the official Elastic Search link.
- Expose Elasticsearch as a Service
- Run the following command to install Elasticsearch as a Windows service:
elasticsearch-service.bat install
- Run the following command to install Elasticsearch as a Windows service:
- Configure Heap Size for Elasticsearch
- To optimize performance, set the Elasticsearch heap size using these JVM settings:
-Xms5g -Xmx5g - Go to the Elasticsearch installation folder (conf).
- Copy the jvm.options file and place it in the jvm.options.d folder.
- Open the jvm.options file in the jvm.options.d folder.
- Find the -Xms and -Xmx values. If they are commented out, uncomment them and change the values to:
Xms8g
-Xmx8g
- To optimize performance, set the Elasticsearch heap size using these JVM settings:
- Configure Elasticsearch
- 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 - 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 - Save and close the file.
- Open the elasticsearch.yml configuration file in a text editor. It is located at:
- Start Elasticsearch as a Service
- Open a command prompt as an administrator.
- Navigate to the Elasticsearch bin directory:
cd C:\Program Files\elasticsearch-8.0.0-windows-x86_64\elasticsearch-8.0.0\bin - Start the Elasticsearch service:
net start elasticsearch-service-x64
- Enable Authentication
- Go to the bin folder.
- Open the command prompt and run:
elasticsearch-setup-passwords.bat interactive - Set and confirm a password for the elastic user.
- Use the same password for all prompted users and store it securely.
- Restart Elasticsearch and Integrate with OE Applications
- After setting up authentication, restart Elasticsearch and connect it to OE applications.
Step 5: Install Tomcat on Windows
- Download and Install Tomcat 9.0.102
- Download Tomcat from the official Apache Tomcat website.
- Extract the downloaded ZIP file.
- Place the backup ovaledge.war file in the Tomcat webapps folder.
- Install Tomcat as a Service Manually
- Open Command Prompt as an administrator.
- Navigate to the Tomcat bin directory.
- Run the service.bat script to install Tomcat as a service.
- Configure Tomcat
- Create a third_party_jars folder and add the backup JAR files.
- Create an Ext-prop folder and add log4j.properties and oasis.properties files.
- In oasis.properties, enter the database and Elasticsearch details.
- 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
- Create a third_party_jars folder and add the backup JAR files.
- Start Tomcat and Verify
- Start Tomcat as a service.
- Check the logs in the Tomcat logs folder to confirm that Tomcat is running successfully.
- Start Tomcat as a service.
Conclusion
By following these instructions, users can successfully transition their OvalEdge setup to a Windows-based environment while maintaining application stability and performance.