Skip to main content
Version: Early Access

Upgrade on new Hardware with Mongo DB on a Separate Server

On RHEL 7.X App server

1. Execute the below steps on the Rhel 7.X server to take the backup.

Stop the services: as-stop-services

2. Take a backup of the Data. Download the backup-restore script to the /tmp directory

wget < backup-restore script link>

3. Make it executable:

chmod +x <backup-restore script>

4. Execute the script:

./<script> -o backup -p <path to data dump> -t (use –db-skip if you want to skip mongo dump)

5. Scp the tar file to Rhel 8 Server.

Steps to install MongoDB on the Rhel 8.X Server

Install

Use the following link to perform the installation of .

::: Note: You must have versions 4.0 - 4.4. :::

https://docs.mongodb.com/v4.0/administration/install-on-linux/

Pro Tip: Make sure that is installed and run as service account and not run as the "root" user. We have found that when the service is run as root several problems occur.

Prerequisites

System Requirements

Before proceeding, please read the System Requirements page.

Server Connectivity During the Install Process

It may be easiest to enable network access for the 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 server as needed.

Create an "agilitysync" user account

On the Linux machine, create a services account for the application account named "agilitysync". This user account is used to install and own the 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

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

Refresh System Variables

Ubuntu:source .profile

RHEL/Centos:source .bash_profile

Download the Latest Installer

Copy the latest installer agilitysync-installer.sh that was provided by the 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 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 agilitysync user

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

Run this commands:

export AGILITYSYNC_MONGODB_SERVER=<IP of the MongoDB server>

echo $AGILITYSYNC_MONGODB_SERVER

Run the Install Script

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

NOTE: Run as the "agilitysync" user. The user that runs this script will be the owner of the 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.

NOTE: -m will Skip MongoDB data initialization in the App Server.

/tmp/agilitysync-installer.sh -m

Change the Default Installation Directories(Optional)

The installer script, by default, installs in these directories---/etc, /opt, and /var. 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 on any directory of your choice.

For example, the following command installs 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.

Configure the below in agilitysync.yaml file:

vim /etc/agilitysync/agilitysync.yaml

add this line: mongodb_server: <IP of the MongoDB server>

And Save

Run the below command for Mongo DB initialization:

cd /opt/agilitysync/current/common/install

./init_mongodb.py

Logout and return

Log out and log back to the Linux server to load environment variables that were added to the profile script of the user. Check that AGILITYSYNC_HOME is set.

echo $AGILITYSYNC_HOME

Disable Optional Services

If you are not using tasks, disable the as-poller service

as-disable-service as-poller

Start

Start the services using the following command.

as-start-services

Restore the Data on RHEL 8.X Server

1. Execute the below steps to restore data

Stop the services: as-stop-services

2. Restore the Data.Download the backup-restore script to the /tmp directory

wget https://versionone-builds.s3.amazonaws.com/agilitysync/scripts/as-backup-restore.py

3. Make it executable:

chmod +x <as-backup-restore.py>

4. Execute the script:

./<as-backup-restore.py> -o restore -p <path of data dump> -t (use –db-skip if you want to skip mongo dump)

Restart the AgilitySync services:

as-restart-services

Log in

Using a browser, go to the login page for using the address http://serveraddress:8080 You should be able to login using the same credentials as before upgrade.