Migrating from 1.0 version to 2.0

In this section, you will find how to migrate from Horusec’s 1.0 version to the 2.0 one.

On May 2021, Horusec made a change in its Github repositories:

With that, all the following services have a new repository:

Other changes also happened:

  • Horusec-Vulnerability was created, a new service responsible to manage all the vulnerabilities found on Horusec-CLI.
  • Horusec-Account service was renamed to Horusec-Core, it will represent better its function in the platform.

Requisites:

Check out below the requirements in the 2.0 version:

  • RabbitMQ: minor version 3.0;
  • PostgreSQL: minor version 11.6;

Postgresql was already a requirement in Horusec’s older version, with only one database and the name was suggested by Horusec’s team in its configuration files.

  • horusec_db

Now, the new version, you need to create a new database on PostgreSQL and the name was suggested by Horusec’s team in its configuration file:

  • horusec_analytic_db

It was necessary to separate the database because the Horusec-API service is loaded with a lot of writing and Horusec-Analytic with reading and these are the critical points of the solution, it has a high availability.

Optional:

There wasn’t a new change on the optional requirement, it continues:

  • A connection with a server SMTP for triggering e-mails.

Migration:

To continue the migration, follow the next steps:

Step 1: Update the services with the lastest version available:

Step 2: Perform the data synchronization to a new version:

  • Add the environment variables and its values in the Horusec-Analytic service:
Environment variables Values
HORUSEC_DATABASE_SQL_URI postgresql://root:root@postgresql:5432/horusec_analytic_db?sslmode=disable
HORUSEC_DATABASE_HORUSEC_SQL_URI {{CONNECTION WITH THE EXISTING DATABASE}}
  1. Helm: If you are using helm, a job inside the helm’s files was already added to be triggered when a new version is executed.

  2. Docker-Compose: If you are using docker-compose, it is necessary to run the migration script of from the older version to the newer. To do that, run the following commands:

docker exec \
-e HORUSEC_DATABASE_SQL_URI=postgresql://root:root@postgresql:5432/horusec_analytic_db?sslmode=disable \
-e HORUSEC_DATABASE_HORUSEC_SQL_URI=postgresql://root:root@postgresql:5432/horusec_analytic_db?sslmode=disable \
-i horusec-analytic /analytic/horusec-analytic-v1-to-v2-migrate
docker exec \
-e HORUSEC_DATABASE_SQL_URI=postgresql://root:root@postgresql:5432/horusec_analytic_db?sslmode=disable \
-i horusec-api /api/horusec-api-v1-to-v2-migrate

Step 3: Update the CLI to the lastest version.


Last modified October 6, 2021: Fix correct version in doc (#119) (6fe77075)