# Run Upgrade Utility on Linux

**Steps to  Run Upgrade Utility on Linux**<br>

* Navigate to the scripts directory

> ```
> apache-tomcat-dbsync/scripts
>
> ```

As shown below

![](https://lh7-us.googleusercontent.com/TVsJeUVhaVrdqlAB0rAKcBSUpZMQBYLM54FqOYKNLpX0cQqQxQdkZ3aDPoFdDOxsdAR4IN8Y-0imqY0AYPoyNjGMMp0Fi8J0F0Ey0xlciwkFcQx1w2mk0HSW70_wJekvGJxM7hpbvlefbq31Kd6J5e8)<br>

Once inside the directory run&#x20;

> ```
> ./upgrade-cli.sh
> ```

<br>

![](https://lh7-us.googleusercontent.com/AGuk9antsf7YFN7Fr40WSmf1_MtZNRrXqpHHOh2M3XfXnYlO0XRUnd9BACPV4NN9oeT9RAyEbmyXytjdZKjquu3aXiCYEynF084OuhS1bzARk8kHxpE3MAXNFJZzfNnrpy6Zc1Po8zGq-MOgwMwm1-o)

<br>

After running the above command you will get the following message and will show the latest version available&#x20;

<br>

![](https://lh7-us.googleusercontent.com/OdBQTqgPuOvuQnliW6cBk4aucCMPBTlaFW98QcGKWj5jhQxDCQY2dr-dNawVwEGnJqtklMUyrDwIOx8hFQ2brFYk1Ml2GdxnxwlzIe3h8fUhYdsR9di92apG7otOtUbz2XTylgB3Spbjn5SQkq2EweY)\
Type Y if you want to upgrade&#x20;

<br>

Once Y is entered it will take a backup of all your files and folders from the previous version

\
![](https://lh7-us.googleusercontent.com/VduWCdqE7Xng00MSTvM1pB5r_uohSZywNW9utws5qoGko4eIdvmwcwmagfc3HIQBSr0a-8EOHXU4h2ICEj8BvH0H0elx-oQlrel0JRdeJsGAPp3syIn99tV97NFp59HTkc-TFHwojNqeVloIRJ3UPhw)

<br>

And will create a backup folder

<br>

![](https://lh7-us.googleusercontent.com/TN2dEVzh7MZiKm9ZE797ehMg1b3NpSDBczot9Tgl7lj9EbBD7yc_8hWSld421x9NHwDfxNPE8OcZ_8AKGfOXxYP8Z4aQVFA8OszgFpFpCDuv58MWTdnpoYune-KVlg6IIj4swWZAcOFcGOzxOee46MA)

<br>

Once the process is completed you can check if your tomcat is running or not if not rerun and log in to dbsync\
There you can find all your profile and configurations done on the older version&#x20;

<br>

### **Manual Backup** <a href="#runupgradeutilityonlinux-manualbackup" id="runupgradeutilityonlinux-manualbackup"></a>

{% hint style="info" %}
If the backup is not created and you see your folders/files missing use the below steps for manual backup. Do this only if you want to Upgrade Manually or If the script fails to upgrade
{% endhint %}

**Moving files from one directory to another**\
Command:

\# mv source directory/\* destination directory/

![](https://lh7-us.googleusercontent.com/ZnLtCXyOXmNG3rAmrKqt7ESb-eYDm9aIoyYeIIKPJ2uoDDqMbqHHNgSiRyn7o6yR_REA2YdorhCaBCfVQlwa3exd5tWf30f6VirmQFGuCT7VfNF6AdOaQrRJ1ERmELFUpYV5h5Tf2rP-4cY6cP-2qBo)

**Copying from one dir to another**

Command :

```
# Cp -r source directory /~/ destination directory 
```

**To check if your tomcat is running or not**&#x20;

```
# ps -ef | grep java
```

* Step: To check the logs you can run the command tail -f Catalina. out as illustrated in the screenshot below

```
# cd /home/dbsync/apache-tomcat-9.0.33/logs
```

```
# ls -l
```

Now Tail the logs

```
# tail -f catalina.out
```

The above screenshot shows that the tomcat was running

Step: To access the DBSync Cloud Replication console, please paste the[ http://< IP >:8080/dbsync](http://localhost:8080/dbsync)

Use the <http://localhost:8080/dbsync>  URL in your browser address bar, and you will be presented with the DBSync Cloud Replication Home page.

**Take a backup of profiles**

* Create a backup directory in the home folder
* mkdir \<folder name>
* Go to the following directory /home/dbsync/dbsync/dbsync-cdm/WEB-INF/profiles/1
* Use the below command to copy the files present inside the profiles folder
* ```
  cp -r <install-dir>/dbsync-cdm/WEB-INF/profiles ~/<destination folder>/
  ```

**Take a backup of Scheduler jobs**

* Create a backup directory in the home folder
* mkdir \<folder name>
* Go to the following directory dbsync/scheduler
* Use the below command to copy the files present inside the scheduler folder
* ```
  cp -r <install-dir>/scheduler ~/<destination folder>/
  ```

\
**Take a backup of System.properties**

> * Go to the Installation directory<br>
>
>   example&#x20;
>
>   (go to the installation directory)
>
>   cd apache-tomcat-dbsync/dbsync-cdm/WEB-INF/db/conf
>
>   <br>
> * Use the below command to copy the files present inside the conf folder
> * ```
>   cp system.properties ~/<destination folder>/
>   ```

\
**Take backup of \<database>.properties files**

* Go to the Installation directory

  example&#x20;

  (go to the installation directory)

  cd apache-tomcat-dbsync/dbsync-cdm/WEB-INF/db/conf
* Use the below command to copy the files present inside the conf folder
* ```
  cp -r <database>.properties ~/<destination folder>/
  ```

  ```
  Example for MYSQL
  ```

  ```
  cp -r mysql.properties ~/<destination folder>/\
  ```

  | **Note: All the backup up folders/files need to be placed at the exact location in the new installation or upgrade location** |
  | ----------------------------------------------------------------------------------------------------------------------------- |
