# Sherpa AI Server Updates

### 1. Downloading Files

Download all the latest files from the links before installation.

### 2. Transferring Files to the Server

After downloading, transfer all files to the target Linux server using any convenient method:

#### Via SCP/SFTP

```bash
# Copy files to the server
scp *.tar.gz *.tgz user@target-server:/path/to/installation/directory/
```

<details>

<summary>💡 Comments on transferring via SCP/SFTP</summary>

**scp&#x20;*****.tar.gz .tgz user\@target-server:/path/to/installation/directory/*** - copies files to the remote server

* `scp` - secure copy
* `*.tar.gz *.tgz` - patterns for selecting files
* `user@target-server` - credentials for connection
* `/path/to/installation/directory/` - destination path on the server

</details>

#### Via SFTP Client

Use any SFTP client (FileZilla, WinSCP, Cyberduck) to copy files to the server.

#### Via Network Folder

If the server is accessible via SMB/CIFS, use Windows Explorer or the `copy` command.

#### Verifying Transfer

```bash
# Connect to the server
ssh user@target-server

# Navigate to the directory with files
cd /path/to/installation/directory

# Check for all files
ls -la *.tar.gz *.tgz

# Check file sizes
ls -lh *.tar.gz *.tgz
```

<details>

<summary>💡 Comments on verifying transfer</summary>

**ssh user\@target-server** - connects to the remote server via SSH

* `ssh` - secure shell
* `user@target-server` - credentials for connection

**cd /path/to/installation/directory** - navigates to the directory with files

**ls -la&#x20;*****.tar.gz .tgz*** - shows detailed information about downloaded files

* `-l` - long format
* `-a` - shows hidden files

**ls -lh&#x20;*****.tar.gz .tgz*** - shows file sizes in human-readable format

* `-h` - human readable (KB, MB, GB)

</details>

### 3. Stopping Containers

```bash
# Stop all running services
docker compose down
```

<details>

<summary>💡 Comments on stopping containers</summary>

**docker compose down** - stops all Docker Compose services

* Stops and removes containers, networks
* Preserves volumes and images

**Verifying stop:** **docker ps -a | grep aiserver** - checks the status of containers

* `docker ps -a` - shows all containers (including stopped ones)
* `| grep aiserver` - filters by the name aiserver

</details>

### 4. Loading Docker Images

```bash
# Create a backup of the .env file
cp .env .env.backup
# Create a backup of config
cp ./oais/backend/config ./oais/backend/config_backup

# If custom certificates are used, copy them to a safe place
cp -r ./oais/backend/config/certs ./certs_backup

# Extract client files
tar -xvzf "$(ls client_files_*.tgz | sort -V | tail -n 1)"

# Make scripts executable
chmod +x sh_scripts/*.sh

# If a backup of certificates was created, restore them
cp -r ./certs_backup/* ./oais/backend/config/certs/

# Load all Docker images
sudo ./sh_scripts/load_all_docker_images.sh
```

<details>

<summary>💡 Comments on loading Docker images</summary>

**Creating backups:**

* `cp .env .env.backup` - backup of the configuration file
* `cp ./oais/backend/config ./oais/backend/config_backup` - backup of the config directory
* `cp -r ./oais/backend/config/certs ./certs_backup` - backup of SSL certificates

**Extraction and preparation:**

* `tar -xvzf "$(ls client_files_*.tgz | sort -V | tail -n 1)"` - extracts the latest client files
* `chmod +x sh_scripts/*.sh` - makes scripts executable
* `cp -r ./certs_backup/* ./oais/backend/config/certs/` - restores certificates

**sudo ./sh\_scripts/load\_all\_docker\_images.sh** - loads all Docker images

**Verifying load:** **docker images | grep aiserver** - shows loaded aiserver images

</details>

### 5. Checking Environment Variables

```bash
# Open the .env file for checking
nano ./.env

# Check for required variables
grep -E "(POSTGRES_PASSWORD|X_API_TOKEN|HOST_IP)" .env

# Check syntax correctness
cat .env | grep -v '^#' | grep '=' | wc -l
```

<details>

<summary>💡 Comments on checking environment variables</summary>

**nano ./.env** - opens the configuration file in the editor

**grep -E "(POSTGRES\_PASSWORD|X\_API\_TOKEN|HOST\_IP)" .env** - checks for the presence of key variables

* `-E` - extended regular expressions
* Lists required variables separated by |

**cat .env | grep -v '^#' | grep '=' | wc -l** - counts the number of variables

* `cat .env` - outputs the content of the file
* `grep -v '^#'` - excludes comments
* `grep '='` - keeps only lines with variables
* `wc -l` - counts the number of lines

</details>

### 6. Starting Containers

```bash
# Start basic services
docker compose up -d

# Or start with additional services
# docker compose --profile whisper up -d
# docker compose --profile reranker up -d
# docker compose --profile full up -d
```

<details>

<summary>💡 Comments on starting containers</summary>

**docker compose up -d** - starts basic services in the background

* `-d` - detached mode

**Profiles for additional services:**

* `--profile whisper` - enables the speech recognition service
* `--profile reranker` - enables the reranking service
* `--profile full` - enables all additional services

**Verifying start:**

* `docker compose ps` - shows the status of all containers
* `docker compose logs -f aiserver` - shows real-time startup logs

</details>

After a successful update, the Sherpa AI Server system is ready for operation.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sherparpa.ru/en/sherpa-ai/sherpa-ai-server/obnovleniya-sherpa-ai-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
