Cloning a BY/JDA WMS Application Server on Windows Server

From time to time, organizations require to build a new BY/JDA WMS Instance on either Windows Server or Linux — depending upon their requirements. Today I will show the simplest example of cloning a BY WMS instance on Windows Server 2016/2019 and editing MOCA Server’s service using the registry editor.

So below is a screenshot of what my current instance looks like and I will do a simple replication.

So now let’s go ahead and copy/paste this instance into a new folder, let’s call it SB20. However, if you use normal windows copy/paste functionality, you might get the Destination Path Too Long error — Click on the hyperlink on how to fix this error.

So, now that we have copied our BY/JDA WMS instance to a new location, we will have to make the following configuration changes:

  1. Add an entry on the rptab file. You can read in detail about rptab setup on the link: RedPrairie/JDA WMS — rptab file
  2. Correct registry and env.bat file for instance-specific values
  3. Backup/Restore database with a new name or schema for Oracle.

Once all of this is done, you can run env.bat followed by msql -S command to validate if you’re able to connect the new instance to the database. Click here to read on Msql utility for more details.

So the next step is to install the MOCA Service to be able to start/stop the instance via Windows Service. Run the env.bat as Administrator and then execute the following command.

servicemgr -e %MOCA_ENVNAME% install

Now you may ask, why does this service look different than the standard install? Well, to be honest, this is the first time I am seeing this on BY WMS 2020. But nevertheless, we can manually fix this. I am presenting you with this problem specifically so you’re aware of it and know how to correct it.

The service manager (servicemgr.exe) is a utility provided in the instance’s MOCA\bin directory to allow an easy way to install the service, but it is not the only way.

So we can run the sc create command to see what parameters are needed to pass in order to create the service manually.

So the parameters that we need are Service Name binPath and DisplayName

sc create MOCA.instancename binpath=" E:\JDA\instancename\MOCA\bin\prunsrv.exe //RS//moca.instancename" DisplayName= “MOCA Server (instancename)”

So let’s create our MOCA Service now.

As you can see that our service looks like how we wanted it to be. However, the description is still missing. To add a description for a service, you can run the following command.

sc description servicename "description for service"

Now let’s attempt to start our service…

If you look at the Event Viewer logs, you will see the following error:

Incorrect function

To fix this issue, we will have to get our hands dirty and fix the windows registry parameters that are used to start/stop the MOCA Services.

The first step would be to take a complete backup, in case of an accident and want to rollback to this state. Open Registry Editior by using regedit from Start > Run. Then select Computer and click on Export.

Note, this step may take a couple of minutes to complete. Now head over to the source instance’s registry and export it. We will edit this export and import it with the target instance’s name.

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\moca.sourceinstance

Once exported, open it in notepad++ or any other text editor and replace the source instance name with the target instance. However, there are some values exported as hexadecimal and we will have to correct those after importing it.

Once all registry entries have been corrected. run env.bat and then run the msql -S utility to validate if you are able to query on the new database. However, this method is dangerous and should be done if you are experienced in modifying the windows registry.

Another way of editing a window’s service is by using the sc config command:

sc config moca.instancename DisplayName="MOCA Server (instancename)"

This goes and changes the registry configuration under:

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\moca.instancename

Hope this helps! Please don’t hesitate to comment below if you have any questions.

--

--

--

I am an experienced IT Consultant who has a knack to solve complex problems. Want to connect? Reach out to me on: http://www.linkedin.com/in/ali-ahmed-jdawms

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Sinatra Portfolio Project

Flatiron School: Trip Planner

Dynamic Partitioning in AAS Tabular Model

Getting started with Terraform and Google Cloud Platform (GCP): deploying a PostgreSQL database…

The Binary Play

SecurityTube Linux Assembly Expert (SLAE) Assignment Writeups — \x06 Writing Polymorphic Shellcode

Tutorial: Securing private content on AWS Cloudfront

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ali Ahmed

Ali Ahmed

I am an experienced IT Consultant who has a knack to solve complex problems. Want to connect? Reach out to me on: http://www.linkedin.com/in/ali-ahmed-jdawms

More from Medium

Pt 1. How to Install and use ClamAV Antivirus on Linux RHEL 8: A Step-by-Step Guide

Compilation in C with GCC command (LINUX)

Cron — Magical wizard in Linux🧙‍♀️

Installing SAC on WSL Ubuntu