Skip to content

Commit 68b3e57

Browse files
authored
Merge pull request #11 from MITLibraries/Update-4.13
Update version and clarify documentation
2 parents f4165fd + d0dd017 commit 68b3e57

File tree

6 files changed

+102
-18
lines changed

6 files changed

+102
-18
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM matomo:4.12.0
1+
FROM matomo:4.13.1
22

33
# Add the EnvironmentVariables plugin
44
COPY ./files/plugin-EnvironmentVariables-4.0.1/ /var/www/html/plugins/EnvironmentVariables
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# How-to instructions
2+
3+
Detailed how-to instructions to compare the running copy of config.ini.php to the version in this repo.
4+
5+
## Command line access
6+
7+
1. Log in to the [AWS Console](https://mitlib.awsapps.com/start#/) to retrieve your `Command line or programmatic access` credentials.
8+
1. Copy the appropriate OS information and paste it into your local terminal.
9+
1. Log in to the docker container in ECS - See [docker-matomo/docs/HowTos/HOWTO-miscellaneous.md](https://github.com/MITLibraries/docker-matomo/blob/main/docs/HowTos/HOWTO-miscellaneous.md) for instructions.
10+
1. Run the backup script:
11+
12+
```bash
13+
/usr/local/bin/backup-data.sh
14+
```
15+
16+
1. Access the EFS mounted copy of config.ini.php.
17+
18+
```bash
19+
more /mnt/efs/config/config/config.ini.php # Hit space until all content is revealed
20+
```
21+
22+
1. Copy/paste this information into a new file in your local editor and save as dev.ini (or other name of your choice).
23+
1. Compare the 2 files for any differences. Ignore any changes in these sections:
24+
* [database]
25+
* [Tracker]
26+
* [mail]
27+
* **NB** Comment lines are not copied to the running/backup copy of config.ini.php.
28+
1. Verify information in the [General] section. **NB** Sometimes the order of various settings will change between Matomo versions
29+
1. Copy any differences in [Plugins] and [PluginsInstalled] to the repo copy of config.ini.php and save.
Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,41 @@
11
# How-to instructions
22

3-
Detailed how-to instructions for upgrade scenarios.
3+
Detailed how-to instructions for upgrading Matomo.
44

55
## Upgrade Database Engine
66

77
The database engine is managed by [mitlib-tf-workloads-matomo](https://github.com/mitlibraries/mitlib-tf-workloads-matomo). In testing, Matomo had no problems with database engine upgrades through different MariaDB versions.
88

99
## Update Matomo version
1010

11+
These instructions assume you are working in the **dev** environment. Change to the appropriate <env> tag if you are working in a different environment.
12+
1113
1. Ensure that a backup of the current `config/config.ini.php` exists in the EFS mount.
12-
1. Publish updated container to ECR.
14+
* SSH (via AWSCLI + Session Manager) to the container(see the [Troubleshooting](./HOWTO-miscellaneous.md) section for the AWS CLI connection command).
15+
* Run the **backup-data.sh** script `/usr/local/bin/backup-data.sh`
16+
1. Make any necessary changes to the repo.
17+
* For version upgrades, change line 1 in **Dockerfile** to the new version.
18+
1. Publish the updated container to ECR.
19+
* Run `make dist-dev` to create the updated container.
20+
* Run `make publish-dev` to push the new container to ECR and tag it as 'latest'.
1321
1. Deploy updated container for ECS service.
14-
1. Verify via webUI that the Matomo installation is ready to be upgraded.
15-
1. SSH (via AWSCLI + Session Manager) to the container and run the upgrade on the CLI (see the [Troubleshooting](./HOWTO-miscellaneous.md) section for the AWS CLI connection command). The database update command is `php /var/www/html/console core:update`.
16-
1. For the 3.x to 4.x upgrade, there is an additional step to update to the utf8mb4 character set. Once the database upgrade is complete, run `/var/www/html/console core:convert-to-utf8mb4` to update the tables.
17-
1. Copy updated `config/config.ini.php` to the EFS mount.
22+
* Via the AWS Console:
23+
* Go to ECS
24+
* Click on **matomo-ecs-dev-cluster**
25+
* Click on the checkbox in **Services** next to `matomo-ecs-dev-service`
26+
* Click `Update`
27+
* On the next page, expand **Deployment options** and choose `Force new deployment`
28+
* Click `Update`
29+
* Via AWS CLI
30+
* `aws ecs update-service --cluster matomo-ecs-dev-cluster --service matomo-ecs-dev-service --force-new-deployment`
31+
*Either method takes a few minutes to complete the deployment. It's easiest to verify completion in the AWS Console. A green bar will appear at the top of the page stating `Service updated: matomo-ecs-dev-cluster:matomo-ecs-dev-service`
32+
1. Verify via webUI that the Matomo installation is ready to be upgraded. Ask someone in DEP to assist with this step.
33+
* This step is only necessary when a database update is required.
34+
1. SSH (via AWSCLI + Session Manager) to the container and run the upgrade on the CLI (see the [Troubleshooting](./HOWTO-miscellaneous.md) section for the AWS CLI connection command).
35+
* The database update command is `php /var/www/html/console core:update`.
36+
* This step is only necessary when there is a required update to the table structure in Matomo listed in the release notes.
37+
1. Copy the updated `config/config.ini.php` to the EFS mount.
38+
* Run the **backup-data.sh** script as in step 1.
1839
1. Verify that there were no changes to the `config.ini.php` file that need to be captured back in this repo.
19-
1. Log back in to the webUI to verify that everything is working.
40+
* See [compare-ini-files](./HOWTO-compare-ini-files.md)
41+
1. Log back in to the webUI to verify that everything is working. Ask someone in DEP to assist with this step.

docs/HowTos/HOWTO-miscellaneous.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,36 @@ The container-based Matomo installation requires a walk through of the web UI to
1515

1616
## Troubleshooting
1717

18-
It **is** possible to SSH into the Matomo container while it is running in ECS:
18+
It **is** possible to SSH into the Matomo container while it is running in ECS: **Ensure you have the latest Session Manager plugin installed if you have errors or no output to the following command:**
1919

2020
```bash
2121
aws ecs execute-command --region {name-of-the-region} --cluster {name-of-the-cluster} --task {task number} --command "/bin/bash" --interactive
2222
```
2323

2424
This can be used for quick checks of the `config.ini.php` file to see if actions in the UI made any modifications. This is also required for doing major version upgrades of Matomo (e.g. from 3.x to 4.x).
25+
26+
To retrieve the **task number** value for the command:
27+
28+
* Open the AWS Dev1 console in your browser
29+
* Navigate to ECS (Elastic Container Service)
30+
* Click on `matomo-ecs-dev-cluster` (This is also the cluster name for the above command)
31+
* Click on the `Tasks` tab
32+
* Copy the Task number from the list (there should be only one)
33+
34+
OR
35+
36+
```bash
37+
aws ecs list-clusters | grep matomo
38+
aws ecs list-tasks --cluster matomo-ecs-dev-cluster (or result from previous command)
39+
# The task number is the 32 character hex string at the end of the line
40+
```
41+
42+
## Reset 2-Factor auth
43+
44+
If we ever need to reset the 2FA configuration for a user, this is the command to run on the CLI of the container
45+
46+
```bash
47+
./console twofactorauth:disable-2fa-for-user --login=yourlogin
48+
```
49+
50+
See [FAQ_27248](https://matomo.org/faq/how-to/faq_27248/) for more details.

files/backup-data.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

3-
/bin/cp -r /var/www/html/config /mnt/efs/config
3+
/bin/cp -r /var/www/html/config/ /mnt/efs/config/
44
/bin/cp -r /var/www/html/misc/user /mnt/efs/misc_user
5-
/bin/cp -r /var/www/html/js /mnt/efs/js
5+
/bin/cp -r /var/www/html/js/ /mnt/efs/js/
66
/bin/cp -r /var/www/html/matomo.js /mnt/efs/matomo.js
77
/bin/cp -r /var/www/html/piwik.js /mnt/efs/piwik.js

files/config.ini.php

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,28 @@
1111
; maximum number of rows for any of the Referers subtable (search engines by keyword, keyword by campaign, etc.), and Custom variables values
1212
datatable_archiving_maximum_rows_subtable_referrers = 5000
1313

14+
; maximum number of rows for the User ID report
15+
datatable_archiving_maximum_rows_userid_users = 5000
16+
1417
; maximum number of rows for any of the Actions tables (pages, downloads, outlinks)
1518
datatable_archiving_maximum_rows_actions = 5000
1619

1720
; maximum number of rows for pages in categories (sub pages, when clicking on the + for a page category)
1821
datatable_archiving_maximum_rows_subtable_actions = 5000
1922

23+
; maximum number of rows for the Site Search table
24+
datatable_archiving_maximum_rows_site_search = 5000
25+
2026
; maximum number of rows for any of the Events tables (Categories, Actions, Names)
2127
datatable_archiving_maximum_rows_events = 5000
2228

2329
; maximum number of rows for sub-tables of the Events tables (eg. for the subtables Categories>Actions or Categories>Names).
2430
datatable_archiving_maximum_rows_subtable_events = 100
2531

26-
; maximum number of rows for the Site Search table
27-
datatable_archiving_maximum_rows_site_search = 5000
28-
29-
; maximum number of rows for the User ID report
30-
datatable_archiving_maximum_rows_userid_users = 5000
31-
3232
[mail]
3333

3434
[Plugins]
35+
Plugins[] = "CoreVue"
3536
Plugins[] = "CorePluginsAdmin"
3637
Plugins[] = "CoreAdminHome"
3738
Plugins[] = "CoreHome"
@@ -71,7 +72,6 @@
7172
Plugins[] = "ScheduledReports"
7273
Plugins[] = "UserCountryMap"
7374
Plugins[] = "Live"
74-
Plugins[] = "CustomVariables"
7575
Plugins[] = "PrivacyManager"
7676
Plugins[] = "ImageGraph"
7777
Plugins[] = "Annotations"
@@ -86,7 +86,10 @@
8686
Plugins[] = "Heartbeat"
8787
Plugins[] = "Intl"
8888
Plugins[] = "Tour"
89+
Plugins[] = "PagePerformance"
90+
Plugins[] = "CustomDimensions"
8991
Plugins[] = "MobileAppMeasurable"
92+
Plugins[] = "CustomVariables"
9093
Plugins[] = "EnvironmentVariables"
9194

9295
[PluginsInstalled]
@@ -150,3 +153,7 @@
150153
PluginsInstalled[] = "ProfessionalServices"
151154
PluginsInstalled[] = "Tour"
152155
PluginsInstalled[] = "EnvironmentVariables"
156+
PluginsInstalled[] = "CoreVue"
157+
PluginsInstalled[] = "MobileAppMeasurable"
158+
PluginsInstalled[] = "PagePerformance"
159+
PluginsInstalled[] = "CustomDimensions"

0 commit comments

Comments
 (0)