Upgrade: How to Get Your Semarchy Installation Files into EC2?

When customers are ready to upgrade to the latest version of Semarchy, they often ask "how do you get the files into the cloud when I am running on AWS?"

This is especially a problem for Microsoft folks who are not used to running on Linux and therefore unfamiliar with how to use PuTTY to transfer files into Amazon Linux.   

This step-by-step guide teaches you how to upload the server installation files so you can quickly get going with your upgrade.

There are 2 choices: Command Line Only versus User Interface (SFTP)

Step-by-step guide for Command Line Only

Prerequisite: If you are on Windows, download and set up PuTTY. If you are on Linux or Mac, open your Terminal window.

Guides on how to use PuTTY:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html

https://linuxacademy.com/howtoguides/posts/show/topic/17385-use-putty-to-access-ec2-linux-instances-via-ssh-from-windows

  1. Find the download URL for the Semarchy server installation files. You can find all the download files here: https://www.semarchy.com/all-downloads/

    Use the Server Installation. That contains the WAR file you need to upgrade. Don't grab the Preconfigured with Apache Tomcat Version as it has too much junk you don't need.

    Once you find the URL, right click and copy it. It should look something like this: https://www.semarchy.com/get/semarchy-xdm-install/


  1. On the command line, use curl to download the Semarchy server installation files: 
    1. curl -L https://www.semarchy.com/downloads/products/4.2/semarchy-xdm-install-<version>.zip -O
    2. Substitute the URL for the one you found in step #1 (It is probably the same as above but do double check in case we move things around and this doc is outdated).
      Change the name of the file to the name corresponding to the current version of xDM that you are download. i.e. change "semarchy-xdm-install-<version>.zip" to the actual file name.
      For example: "semarchy-xdm-install-4.2.1.ga-20171129-1528.zip" (If you have trouble with this, refer to the note below)
    3. Note: If you have trouble with downloading the server files because the URL is no good, find the URL using these steps: 

      1. curl -i https://www.semarchy.com/get/semarchy-xdm-install/
      2. You will see this output:
        HTTP/2 302 

        date: Fri, 08 Dec 2017 22:28:41 GMT

        content-type: text/html; charset=UTF-8

        content-length: 0

        set-cookie: __cfduid=df7a5e0b82b2898225dbb2bdcbe0080951512772121; expires=Sat, 08-Dec-18 22:28:41 GMT; path=/; domain=.semarchy.com; HttpOnly

        set-cookie: wp_dlm_downloading=eyJkb3dubG9hZCI6OTc2NiwidmVyc2lvbiI6IjQuMi4yIn0%3D; expires=Fri, 08-Dec-2017 22:29:41 GMT; Max-Age=60; path=/; httponly

        location: /downloads/products/4.2/semarchy-xdm-install-4.2.2.ga-20171207-1650.zip

        server: cloudflare-nginx

        cf-ray: 3ca328bf3ea4569f-IAD
      3. Take the value after locations: and construct your URL by adding https://www.semarchy.com. e.g. https://www.semarchy.com/downloads/products/4.2/semarchy-xdm-install-4.2.1.ga-20171129-1528.zip
      4. curl https://www.semarchy.com/downloads/products/4.2/semarchy-xdm-install-4.2.1.ga-20171129-1528.zip -O
  2. You have successfully downloaded the server installation files into the /tmp found in your EC2 machine. Well done. 
  3. To examine the zip file:
    1. unzip -l /tmp/semarchy-xdm-install-4.2.1.ga-20171129-1528.zip | grep war
    2. Substitute the name of the file to the name corresponding to the current version of xDM you are trying to download.
    3. You should see a list of at least 2 files:
      1. semarchy-passive.war
      2. semarchy.war 

        What's the passive file?

        If you have load balancing, you will use semarchy.war for your active (master) application and you will use semarchy-passive.war for the passive (slave) application. If you don't have load balancing, then ignore the semarchy-passive.war. If you have no idea what I'm talking about, definitely ignore semarchy-passive.war.


  1. To unzip the semarchy.war file which you will need for upgrade, use this command: 
    1. Extract just the file we need:
      1. unzip -j /tmp/semarchy-xdm-install-4.2.1.ga-20171129-1528.zip mdm-server/semarchy.war
      2. You will use this semarchy.war in the upgrade with Tomcat Manager.


Now you are ready to deploy! Follow this upgrade guide to deploy the xDM Application using the Tomcat Manager.


Pros of this approach:

  1. Downloading using the Amazon EC2 machine is ridiculously fast compared to first downloading the server installation files onto your computer and then moving them into EC2. 
  2. It is straightforward because there's only one command which you can copy and paste (though you must edit the URLs and file names). It's harder to mess up than using an application with a lot of buttons. 

Pros of this approach:

  1. Have to find the URL for the curl command and update the file names. 
  2. No user interface. Some people can find the command line intimidating

Step-by-step guide for User Interface 

You can use an application like FileZilla, Cyberduck, and other SCP/SFTP programs to upload the file. 

Try FileZilla as it is free, widely used and therefore widely downloaded. We won't include a guide here because the software is constantly being updated and therefore the interface changes. 

Here are some guides. 

https://stackoverflow.com/questions/16744863/connect-to-amazon-ec2-file-directory-using-filezilla-and-sftp

https://www.siteground.com/tutorials/ftp/filezilla/

https://www.digitalocean.com/community/tutorials/how-to-use-filezilla-to-transfer-and-manage-files-securely-on-your-vps

The important points to remember are: 

  • You will need to use your private key. You may need to convert it into a .ppk file.
  • You must first download xDM server files onto your computer to be able to upload them later into the EC2 machine. 
  • You have to use SFTP. Regular, unsecured FTP won't work. 
  • Drag and drop your zipped folder of server files into the /tmp folder.
  • Here's some tips for the connection information:
    • Create a New Site (in the Site Manager) pointing to the appropriate EC2 site:
      • Hostname = IP address, Port = (leave it bank)
      • SSH protocol
      • Normal
      • User=ec2-user, Password=blank
      • Add the private key

Pros of this approach:

  1. Graphical user interface

Cons of this approach: 

  1. Weird glitches can happen. I often run into a problem or something is not working and I don't know why. LIke permissons which can be easily overcome by creating a new folder and moving files into that folder instead of directly into /tmp.
  2. Much slower than the command line approach. 

If you have trouble with the User Interface, please try the command line. The UI method is terrible often with connecting to EC2.

Now you are ready to deploy! Follow this upgrade guide to deploy the xDM Application using the Tomcat Manager.


If you stil have problems, email support@semarchy.com.