Skip to main content
Version: Early Access

Upgrade MongoDB to Amazon DB while upgrading AgilitySync to RHEL 8

Overview

Follow these instructions step-by-step to Upgrade MongoDB to Amazon DB while upgrading AgilitySync to RHEL 8, this can be done with existing MongoDB on same box or on separate Box.

  1. Create a cluster in Amazon DB using Amazon Web Services(AWS) documentation.
  2. Assign the current App Box to the Cluster.
  3. Download the Amazon DocumentDB Certificate Authority (CA) certificate required to authenticate to your App box.
  4. Check the cluster connection using the mongo shell command given in document DB cluster in AWS.

Steps to perform on Application Server

Prerequisites

Before proceeding, please read the System Requirements page.

Steps to perform on Application Server

Server Connectivity During the Install Process

It may be easiest to enable network access for the Agility Sync server to pull down the installation files as needed; however, this is not required. If outbound network access to the internet is against organization policy the files can be dropped on the server by downloading to another server or desktop and transferring the files to the target Agility Sync server as needed.

Create an "agilitysync" user account

On the Linux machine, create a services account for the Agility Sync application account named "agilitysync". This user account is used to install and own the Agility Sync application.

sudo useradd -m agilitysync

Then set a password for the account:

sudo passwd agilitysync

Verify that shell (/bin/bash or /bin/sh) is set, if not add it:

grep agilitysync /etc/passwd

Add "agilitysync" user to sudoers file

echo "agilitysync ALL=(ALL) NOPASSWD: ALL" | sudo tee -a /etc/sudoers

Verify sudo Capability

The "agilitysync" user account used to run the install must have sudo capabilities. Add this user to the "sudoers" group by following steps specific to your OS. This can be tested by running the following command as the user account. Switch user account to "agilitysync" with the command su - agilitysyncand then test sudocapability with this command:

  1. Switch user account to "agilitysync"

su - agilitysync

  1. Test sudo capability

sudo echo "helloworld"

An error such as "user not in sudoers file" must be corrected before proceeding.

Curl

"curl" must be installed on the server to download the install script to run and to complete these directions. "wget" is a popular alternative and can be substituted in these instructions where applicable.

Python 3.6/3.8

requires Python 3.6 for RHEL 7.x/CentOS7.x and 3.8 for Ubuntu 20 to run, which is installed by default. You can run the following commands to install Python 3.x:

  1. Update package list

apt-get update

  1. Install Python 3.x

For Ubuntu, use minstall python3.8

For RHEL 7.x/CentOS7.x, use yum install python36

Check Time and Timezone Settings

This would be a good time to make sure that your Linux server has NTP (network time protocol) configured properly, the date and time are correct and the timezone is configured properly for the locale of the server. The date and time matter on reports so choose the timezone that most accurately reflects yours organizations primary business operations.

For more information on setting server time zone, see Setting the Time Zone topic in the documentation.

Installing Digital.ai Agility Sync

To install the Agility Sync platform, perform the following steps on the Linux server. This begins with installing the database servers, then creating running the Agility Sync installer and configuring the databases.

Refresh System Variables

Ubuntu:source .profile

RHEL/Centos:source .bash_profile

Download the Latest Agility Sync Installer

Copy the latest installer agilitysync-installer.sh that was provided by the Agility Sync team to a temporary directory (Example: /tmp) and run the following command. This file contains both the latest application and the script to perform the install.

In the following command, substitute theurlin the command below with the url that was provided by the Agility Sync support team.

curl -o agilitysync-installer.sh "url"
mv agilitysync-installer.sh /tmp/agilitysync-installer.sh

If the target server is not connected to the internet, download the installation file to an intermediate server then sftp to /tmp.

Make it Executable

Make the script executable and change the script owner to agilitysyncuser

chmod +x /tmp/agilitysync-installer.sh
chown -R agilitysync.agilitysync /tmp/agilitysync-installer.sh

Run the Install Script

The following options will NOT start the Agility Sync services(-p) after the installer completes.

NOTE: Run as the "agilitysync" user. The user that runs this script will be the owner of the Agility Sync application, files, and directories. This user should not be the root user. A common practice is to create a service account on the Linux machine called "agilitysync".

**NOTE:**Do not run the installer using "sudo" or using the root user, the script itself will sudo when it needs to.

/tmp/agilitysync-installer.sh -msp

Change the Default Installation Directories(Optional)

The Agility Sync installer script, by default, installs Agility Sync in these directories---/etc, /opt, and /var. Agility Sync default installation directories are:

  • base_dir—/opt/agilitysync
  • var_dir—/var/agilitysync
  • etc_dir—/etc/agilitysync

However, you can change the default installation directories and install Agility Sync on any directory of your choice.

For example, the following command installs Agility Sync on custom install directories with the -b, -v, and -e command-line options.

/tmp/agilitysync-installer.sh -b /myapps/soft/agilitysync -v/myapps/prod/agilitysync -e /myapps/app/agilitysync

When you skip one of the custom paths, the installer falls back to the default. For example, if you ignore the -e option, the installer picks the default etc_dir, which is /etc/agilitysync.

Create a user in DocumentDB using an encrypted password.

a. Download the backup script to App Server:

cd /tmp

wget <script.py>

a. Make it Executable:

chmod +x <script.py>

a. Encrypt a password:

./script.py -o encrypt --encryption_key "key from agilitysync.yaml file" --password_to_encrypt "password"

Make a note of the plain password and the encrypted password.

  1. Script to add a new user in App box (which will be used for cluster setup):

cd /opt/agilitysync/current/common/install/

./adduser_mongodb.py --adminuser <DocumentDBCluster username> --adminpassword <DocumentDBCluster pwd> --newuser syncuser --newpassword <new encrypted pwd> --replicasetname rs0 --replicasethosts <replicahostname> --sslcacertfile /etc/global-bundle.pem --ssl true

Login to Existing App server to take backup of existing Data

  1. Stop Services:

as-stop-services

  1. Download the backup script to App Server:

cd /tmp

wget \<script.py\>

Make it Executable:

chmod +x \<script.py\>

  1. Run the backup script:

`cd /tmp

./script.py -o backup -p </tmp> -t`

(a tar.gz file gets created under the specified path)

  1. Copy the above tar file to the new App server.

Login to the New App server

  1. Run the restore script using the below parameters:

cd /tmp

./script.py -o restore \--mongo-host \<replicate hostname\>
\--mongo-user syncuser \--mongo-pass \"Mongo User\'s un-encrypted
password\" \--mongo-ssl-ca-certs /etc/global-bundle.pem \--mongo-ssl
true -p \<path to backup tar file\> -t
  1. Modify the agilitysync.yaml

vim /etc/agilitysync/agilitysync.yaml

Add Amazon Cluster details like below:

mongodb_replicaset_hosts: \<replicate hostname\>

mongodb_database: agilitysync

mongodb_username: syncuser

mongodb_password: \<Encrypted pwd of the user\>

mongodb_ssl: true

mongodb_ssl_ca_certs: /etc/global-bundle.pem

mongodb_replicaset_name: rs0

mongo_retry_writes: false

mongodb_read_preference: secondaryPreferred
  1. And Save.
  2. Start services:

as-start-services