Home > Help center > Billia Instructions > Billia 4.0 migration guide

Billia 4.0 migration guide

Table of contents

  • Rename all environment variables from AH_API_* to AH_BILLIA_* for all backend software;
  • Populate newly required: AH_ELASTIC_HOST, AH_ELASTIC_PORT, AH_ELASTIC_USER, AH_ELASTIC_PASSWORD variables;
  • Upgrade elastic search to version >= 7.2, < 8.0. PHP SDK will be updated automatically:

- Updating elasticsearch/elasticsearch (v5.4.0 => v7.2.2)

  • run public/index.php (from the new version) script before upgrading the service, to check all environments are populated docker run registry.apihawk.tech/apihawk/billia:latest ./public/index.php;
  • Install Consul (https://www.consul.io) on server. The consul should be accessible at host: consul:8500.

When consul is installed and service is restarted, you will be able to see every backend software registered as a service in your service discovery:

service discovery

If everything works properly, after the first request to the software you will be able to see the new file ./config/service_discovery with the following content:

Service Discovery: Enabled
2019-09-13 12:39:02

After installing the consul service, all software will automatically begin communicating with it for service discovery and configuration storage. When running the software, an error like this appears:

Missing required configuration variable: AH_BILLIA_HOST With storage mapping: billia/host. 
You can configure the variable via ENV or at your centralised service discovery software (Consul)

Keep in mind, that every Consul service has HTTP Health check. If a specific service is down for more than 10 minutes, it will be automatically deleted from Consul Service Discovery.

When all variables are provided, a new file will be generated:./config/variables.compiled.php

  • Make sure all services have the same version. A Must for Billia & PaymentGateway;
  • Install AppCell Beta service in your docker cluster. This will allow Billia to communicate with the new AppCell engine in order to provision services;
  • Make sure your AppCell instance has access to: repository.appcell.io
  • Add required environment variables to Billia (env: AH_APPCELL_HOST), Customer Panel (env: APPCELL_URL)
  • Run OnAppDNSCell service from: registry.apihawk.tech/appcell/onappdnscell:latest

This service will be used for DNS management of your domains. Prior to running the service, you have to configure the Catalog Product Option: dns_provider with choice: OnAppDNS, to ensure that everything will operate properly.

  • If OnAppDNSCell is not installed, you have to use the AppCell API:
curl -X POST \
  'http://appcell.test/cell/install' \
  -H 'Content-Type: multipart/form-data' \
  -H 'cache-control: no-cache' \
  -H 'content-type: multipart/form-data' \
  -F plugins=@/data/plugins.json \
  -F resources=@/data/resources.json \
  -F appcell=@/data/appcell.json \
  -F settings=@/data/settings.json \
  -F schema=@/data/schema/schema.zip *schema param is optional
  • Remove all existing clients (applications) (db table: oauth_clients) and switch all systems to use client_id: default. This will be a part of the new Reseller Functionality. If any panel is not able to access data or displays errors, e.g. account is not found, data is not found, it is probably caused by a misconfiguration of the client_id variable. All software should be with the same (default) client_id in order to be able to access the same data.

  • When installing the PaymentGateway Software, you will be asked for a Billia Access Key. You must be authenticated as an Admin in order to create such a key, using the API: {{host}}/user/access-key