# 2.0 Updating

# Preparation


1. Contact `support@cybersift.io` to provide you with a unique URL to download the package. 
2. Create a directory for Cybersift Drive 
3. Unzip the zip file:

```bash
unzip [package-name].zip
```

3\. This will result in a file named `filedrive` and a folder named `/build`



***

## :warning: Backup the database


1. Navigate to the cs-drive installation folder, usually: `cd /root/cs-drive`
2. Copy the SQLite database:

```bash

supervisorctl stop cs_drive # ensure no activity is written to database while backing up

cp drive.db* /tmp/ # copies the SQLITE files to /tmp

supervisorctl start cs_drive # start the service back up
```



***

## Update the backend


1. Navigate to the cs-drive installation folder, usually: `cd /root/cs-drive`
2. Run the following:


:::tip
make sure to change `/path/to/filedrive` on line 3

:::

```bash
rm -rf ./filedrive.bak # remove old backup

mv ./filedrive ./filedrive.bak # this backs up the current verion of the backend

cp /path/to/filedrive ./filedrive # ⚠️ CHANGE THIS LINE TO MATCH THE PATH from "preparation" above 
chmod +x ./filedrive  # give executable permissions to the backend

supervisorctl restart cs_drive # use the new binary, wait for successful completion
```



***

## Reverting Upgrade [Back-End]


:::info
At this point, visiting the CS-DRIVE URL should work. If not, revert:

```bash
cd /root/cs-drive

rm -rf ./filedrive

mv ./filedrive.bak ./filedrive

supervisorctl restart cs_drive
```

:::



***

## Update the front-end


1. Navigate to the cs-drive installation folder, usually: `cd /root/cs-drive`
2. Run the following:


:::tip
make sure to change `/path/to/build`on line 5

:::

```bash
rm -rf ./ui_bak # remove old backups

cp -rf ./ui ./ui_bak # this backs up the current verion of the frontend

cd ./ui

rm -rf ./build* #remove old version of UI

cp -rf /path/to/build ./build # ⚠️ CHANGE THIS LINE TO MATCH THE PATH from "preperation" above 
```



***

## Reverting Upgrade [Front-End]


:::info
At this point, visiting the CS-DRIVE URL should work. If not, revert:

```bash

cd /root/cs-drive

rm -rf ./ui

mv ./ui_bak ./ui
```

:::


# Experiencing issues? 

Contact us at support@cybersift.io



---


:::info
tags:

* Upgrading 
* Updating
* Reverting upgrade
* issues

:::

---

**Documents**

- [1.0 Getting Started](https://outline.cybersift.io/s/cs-drive/doc/10-getting-started-uRQNa8gyos)
- [2.0 Updating](https://outline.cybersift.io/s/cs-drive/doc/20-updating-MLRKSOfzo0)
- [3.0 Development](https://outline.cybersift.io/s/cs-drive/doc/30-development-UcOt6ecH7O)
- [FAQ](https://outline.cybersift.io/s/cs-drive/doc/faq-Qu4pHGbI2B)