This document describes the process of migrating the system from version 1.4.0 to version 1.5.0.
Migration includes updating the PostgreSQL and ClickHouse database schemas, as well as transferring data.
Before starting the migration, be sure to back up all data as described in Preliminary steps section. |
Recommended resources for successful migration (based on a system with 3,000 employees, 2,200 passes, and 300 cameras):
Use Migration on the current server scenario if the update is performed on the same server where the system with version 1.3.1 is already running. |
Use Migration on a new server scenario, if the migration is performed on a new clean server. |
Create a temporary folder for backup and migration files in the user's home directory:
mkdir ~/backup cd ~/backup mkdir db_migration-1.4.0-1.5.0 |
Before dumping the database, it is necessary to stop the services.
sudo systemctl stop evi-core evi-scud evi-live evi-archive evi-analyzer |
echo "SELECT pg_terminate_backend(pid) FROM pg_stat_activity where usename='core'" | sudo -u postgres psql -A -t |
Perform a dump of the current PostgreSQL database:
sudo -u postgres pg_dump core > evi-backup.dump |
Then proceed to the Migration on the current server or Migration on a new server step, depending on requirements.
Use this scenario if the update is performed on the same server where the system is already running. |
While in the ~/backup folder, run the following commands:
wget https://archive.eltex-co.ru/evi-raw/evi-1.5.0/db_migration-1.4.0-1.5.0.tar tar -xf db_migration-1.4.0-1.5.0.tar -C db_migration-1.4.0-1.5.0 cd db_migration-1.4.0-1.5.0 |
sudo apt purge evi-core-web evi-core evi-scud evi-live evi-archive evi-analyzer nginx |
Perform the necessary preliminary steps as described in the Preparation for installation section.
Since the PostgreSQL database is already installed, the next step is to install ClickHouse: see the Installing the database section, ClickHouse database subsection.
sudo bash migrate.sh <host> <user> <password> <psql_db_name_from> <psql_db_name_to> <psql_port> <ch_def_user_password> <ch_db_name> |
sudo bash migrate.sh localhost core core core core 5432 core core |
After successfully executing the migration script, the "Restoring DB done <3" message will appear in the console.
Then proceed to the Verification of configuration files section.
Use this scenario if the migration is performed on a new clean server. |
Perform the necessary preliminary steps as described in the Preparation for installation section.
Install and configure PostgreSQL and ClickHouse as described in the Installing the database section.
Back up all data as described in the Preliminary steps section.
Copy the backup folder along with all its contents from the source server to the new one.
For data transfer, it is recommended to use the scp utility, which provides secure copying via SSH.
scp -r ~/backup <username>@<remote-server>:~ |
After the transfer, switch to the backup folder in the new server:
cd ~/backup |
sudo -u postgres psql -c "CREATE USER core; ALTER USER core WITH PASSWORD 'core'; ALTER USER core WITH SUPERUSER;" |
If necessary, change the password to a more secure one. The examples use the default password and username. |
Download database of the current version:
sudo -u postgres createdb core sudo -u postgres psql -d core -f evi-backup.dump |
Ensure that the dump is downloaded correctly. |
wget https://archive.eltex-co.ru/evi-raw/evi-1.5.0/db_migration-1.4.0-1.5.0.tar tar -xf db_migration-1.4.0-1.5.0.tar -C db_migration-1.4.0-1.5.0 cd db_migration-1.4.0-1.5.0 |
sudo bash migrate.sh <host> <user> <password> <psql_db_name_from> <psql_db_name_to> <psql_port> <ch_def_user_password> <ch_db_name> |
sudo bash migrate.sh localhost core core core core 5432 core core |
After successfully executing the migration script, the "Restoring DB done <3" message will appear in the console.
Then proceed to installing and configuring EVI services, as described in the Ubuntu 22.04.5 LTS section.
Version 1.5.0 includes changes to the structure and settings of the configuration files, which can be viewed at Platform configuration section.
After completing the migration, perform the following steps:
If errors occur, contact technical support with the logs. |