Loading...

INSTALLATION AND UPDATES

EXTENSION INSTALLATION ON ADOBE COMMERCE / MAGENTO

Adobe Commerce / Magento has reliable and robust installation process based on composer. Composer is a dependency management tool well-supported by the community of PHP developers.

Note: This documentation describes installation on Magento 2. For Magento 1, please refer to the Magento 1 Installation and Updates documentation.

Since composer not only makes the installation and upgrade process easier, but also helps to ensure the compatibility of the components, it is the only supported installation option for extensions for Adobe Commerce / Magento.

The Magento 2 installation process consists of the following steps:

  1. Setup access to composer repository on https://insightsready.com.

  2. Install the composer package with the extension to Magento 2 Instance.

  3. Configure database connections for Sales Cube (if Sales Cube functionality was installed).

  4. Setup crontab configuration for the scheduler.

Setup access to composer repository

Get repository access information

On the website settings page you may find access data for the composer repository. To open website settings, go to Account page on https://insightsready.com, menu item "My Websites" and select a website from the list. Click on "Show repository access data" to display the repository URI, repository username and password.

Add repository to composer.json

Add repository access information to composer.json repositories. Open composer.json file in base folder with Magento Instance installation and add the following section to "repositories":

{
  "type": "composer",
  "url": "https://repo.insightsready.com/"
}

Add authentication information to auth.json

Create file auth.json inside base directory of Magento Instance installation if it was not created before and add the following content to it:

{
  "http-basic": {
    "repo.insightsready.com": {
      "username": "<user from website settings page>",
      "password": "<password from website settings page>"
    }
  }
}

Alternatively, a system-wide auth.json could be used in composer home directory (~/.composer).

Installing extension's composer package, M2

Depending on the purchased Power BI Integration Extension package, there will be a composer metapackage available for the installation.

The name of the metapackage could be found in the "Licensed Software Details" list on website details page ("My Websites" on https://insightsready.com -> "Details").

Meta-package name on client website details page on Insights Ready
Website
Picture: Meta-package name on client website details page on Insights Ready Website

Meta-package name on client website details page on Insights Ready Account

Following is example of commands that will trigger the installation of the extension:

composer require bim/pbi-sales-cube-metapackage-magento2:2.2.16.10

bin/magento setup:upgrade

bin/magento setup:di:compile

"bim/pbi-sales-cube-metapackage-magento2:2.2.16.10" would need to be replaced with the available metapackage name and their version.

Sales Cube database configuration

Create database for DWH storage in MySQL 5.6 or MySQL 5.7.

Add "bim_dwh" and "bim_data_export" connection information to app/etc/env.php file of Magento installation.

"bim_dwh" should point to the newly created MySQL database for DWH storage.

"bim_data_export" should point to Magento database. This connection might also be pointing to a read-only replica of the main Magento database for decreasing the load on the productive Magento database. It could be just a copy of Magento database settings for the initial setup.

Configuring database connections on Magento:

<?php
return array( 
    'db' => array(
        'connection'
            'default' => array(
                'host' => 'localhost', 
                'dbname' => 'magento2', 
                'username' => 'magento2_user'
                'password' =>'********', 
                'model' => 'mysql4'
                'engine' => 'innodb' 
                'initStatements' => 'SET NAMES utf8;'
                 'active' => '1', 
            ), 
            'bim_data_export' => array( 
                'host' => 'localhost',
                'dbname' => 'magento2',
                'username' => 'magento2_user',
                'password' => '********'
                'model' => 'mysql4',
                'engine' => 'innodb',
                'initStatements' => 'SET NAMES utf8;', 
                'active' => '1', 
            ), 
            'bim_dwh' => array( 
                'host' => 'localhost', 
                'dbname' => 'magento2_dwh',
                'username' => 'dwh_user',
                'password' => '******* '
                'model' => 'mysql4', 
                'engine' => 'innodb', 
                'initStatements' => 'SET NAMES utf8; 'active' => '1',
            ),
            ...

Additionally, the connections needs to be added in resources section in the app/etc/env.php file.

    ...
    'resource' => [ 
        'default_setup' => [ 
            'connection' => 'default'
        ],
        'bim_dwh' => [ 
            'connection' => 'bim_dwh' 
        ],
        'bim_data_export' => [ 
            'connection' => 'bim_data_export'
        ],
    ... 

Setup crontab scheduler

Run by crontab the following command every minute:

bin/magento bim:etl:scheduler

Below you will find the example of the corntab configuration (type "crontab -e" in command line to start editing the crontab configuration).

Configuring crontab scheduler job on Magento 2:

* * * * * php /path/to/magento2/bin/magento bim:etl:scheduler >> /path/to/magento2/crontab-bim.log 2>&1

UPDATING TO THE LATEST VERSION

Check current and latest versions

This section describes the update process for Magento 2 setup.

It is recommended to always specify the exact version of the installed package in composer.json file. So, instead of having the version defined as "^2.1.0" or "2.*" or ">2.1.0", just enter the version number without any prefixes: "2.1.0".

In order to verify, what version is installed, the command composer show might be used:

composer show | grep bim

or use the exact package name

composer show bim/pbi-sales-cube-beta-metapackage-magento2

To see the list of available versions, add -all option to the show command.

composer show bim/pbi-sales-cube-beta-metapackage-magento2 -all

Alternatively you may login to the account who owns the license on https://insightsready.com website and check if the metapackage version was increased for the package.

Information about the critical updates will be sent via the contact email, specified for the account on https://insightsready.com

Installing the update

You can install the update by changing the version of the package in composer.json file and running the standard composer update command:

composer update

Or use the composer require --update-with-dependencies command in order to avoid updating other packages, not related to the extension:

composer require --update-with-dependencies bim/pbi-sales-cube-beta-metapackage-magento2:2.3.0

Troubleshooting unsuccessful updates

Sometimes you may face issues with the update. Please, do the following in case of issues:

  1. Uninstall the package:
composer remove bim/pbi-sales-cube-beta-metapackage-magento2
  1. Clean up composer cache:
composer clear-cache
  1. Retry installing the package :
composer require bim/pbi-sales-cube-beta-metapackage-magento2:2.3.0
\newpage