Skip to content

Updating to a new major version

To run the new major version of GitFlic, Java 17 or higher is required.

Before updating, you need to determine the GitFlic installation method:

  • basic installation on Linux;
  • installation on Astra Linux;
  • running with Docker Compose.

When using the basic installation or Astra Linux, you must check the Java version in the system before updating. When using Docker Compose, the required Java version is already included in the GitFlic image.

Before switching to the new version, it is recommended to create a backup of the GitFlic database and files.

Basic installation on Linux

Before updating, you need to check the Java version:

java --version

Java 17 or higher must be used to run the new version of GitFlic.

If GitFlic is running as a systemd service, you additionally need to check the Java version at the path specified in ExecStart:

/usr/bin/java --version

To check Java as the GitFlic system user, run:

sudo -u gitflic /usr/bin/java --version

In all cases, Java 17 or a newer version must be displayed.

Updating Java

If a version lower than Java 17 is used, you need to install OpenJDK 17.

For Debian-based systems, an example installation looks like this:

sudo apt update
sudo apt install openjdk-17-jdk

If multiple Java versions are installed on the system, you can check the available options with the command:

sudo update-alternatives --config java

In the list, you must select Java 17 or a newer version.

After the change, re-check the version:

java --version
sudo -u gitflic /usr/bin/java --version

After preparing Java, you can perform the standard GitFlic update.

For a systemd-based installation, you need to:

  1. Stop GitFlic:

    sudo systemctl stop gitflic-server
    
  2. Replace gitflic.jar with the file from the new version's distribution package:

    sudo cp gitflic.jar /opt/gitflic/bin/gitflic.jar
    
  3. Start GitFlic:

    sudo systemctl start gitflic-server
    
  4. Check the service status:

    sudo systemctl status gitflic-server
    

Updating on Astra Linux

The new major version of GitFlic requires Java 17 or higher.

Before changing the repository configuration, you need to determine the Astra Linux version in use and check for openjdk-17-jdk in the official repositories.

You can check the availability of the package for a specific operating system version in the Astra Linux repository navigator.

To search, specify the package:

openjdk-17-jdk

In the search results, you need to check:

  • the Astra Linux release;
  • the repository containing the package;
  • the available package version.

If openjdk-17-jdk is not available for the Astra Linux version in use, you must prepare an environment with Java 17 or higher before updating GitFlic.

Connecting repositories

To install packages from the Astra Linux extended repository, the main and extended repositories corresponding to the operating system version in use must be connected.

You can check the current configuration with the command:

cat /etc/apt/sources.list

If the file contains a disk-based installation source like:

deb cdrom:

it must be commented out.

For Astra Linux 1.8, an example configuration looks like this:

deb https://download.astralinux.ru/astra/stable/1.8_x86-64/repository-main/ 1.8_x86-64 main contrib non-free
deb https://download.astralinux.ru/astra/stable/1.8_x86-64/repository-extended/ 1.8_x86-64 main contrib non-free

The repository configuration must match the installed and supported Astra Linux version.

After changing the repository list, you need to update the package information:

sudo apt update

Check the availability of OpenJDK 17 in the connected repositories:

apt policy openjdk-17-jdk

If the package is available, install Java 17:

sudo apt install openjdk-17-jdk

After installation, check the version:

java --version

If multiple Java versions are installed on the system, select the required one:

sudo update-alternatives --config java

After selection, re-check the Java used by GitFlic:

java --version
sudo -u gitflic /usr/bin/java --version

The version must be Java 17 or higher.

After preparing Java, the GitFlic update is performed in the standard way:

sudo systemctl stop gitflic-server
sudo cp gitflic.jar /opt/gitflic/bin/gitflic.jar
sudo systemctl start gitflic-server

After starting, check the service status:

sudo systemctl status gitflic-server

Updating when using Docker Compose

When running GitFlic with Docker Compose, you do not need to install or update Java on the host system.

The required Java version is already included in the GitFlic Docker image. To switch to the new major version, you need to update the application image in use.

Updating the image from a registry

If the GitFlic image is pulled from a registry, you need to go to the directory with docker-compose.yaml and pull the new version of the image:

docker compose pull

After pulling the image, restart the services:

docker compose down
docker compose up -d

Updating the Enterprise image from a file

If the Docker image is included in the Enterprise distribution package, you need to load the new image into Docker:

docker load -i gitflic-server-ee.tar

In the .env file, specify the image of the new version:

GITFLIC_IMAGE=gitflic-server-ee:<current tag>

After the change, start the services:

docker compose down
docker compose up -d

When updating the Docker image, you do not need to separately change the Java version inside the container.

Updating environment variables

When updating, you need to change the name of the variable for connecting to Redis. You must specify a new name for the environment variable: it was REDIS_HOST, now it is SPRING_DATA_REDIS_HOST; similarly, you need to change the names of the parameters REDIS_PORT, REDIS_USERNAME, REDIS_PASSWORD to SPRING_DATA_REDIS_PORT, SPRING_DATA_REDIS_USERNAME, SPRING_DATA_REDIS_PASSWORD.

Post-update verification

After updating, you need to check that GitFlic starts.

For an installation on an operating system:

sudo systemctl status gitflic-server

For an installation using Docker Compose:

docker compose ps

After a successful start, you need to open the GitFlic web interface and check that the application is accessible.

If a startup error occurs, you need to check the application log.

For a standard installation:

tail -f /opt/gitflic/logs/server.log

For Docker Compose:

docker compose logs

Automated translation!

This page has been automatically translated. The text may contain inaccuracies.