This documentation provides a step-by-step guide on how to take a backup of a custom Matomo plugin, including its code, MySQL table, and associated scraper file, before upgrading Matomo.
Prerequisites
Access to Cpanel or Hosting where Matomo is hosted.
Steps to Backup the Custom Plugin
1. Locate the Custom Plugin
Go to public_html i.e. root directory of Matomo, go to the plugins folder, and find the “Custom Plugin” folder. Press right-click on this folder and compress it as explained in the following screenshot.
Select Zip Archiver and hit the compress files button. After a while, reload the page and you will see a zip file. Download it on your local computer and save it.
2. Backup MySQL Database
Login to CPanel, if you already are not, go to the databases section, and click on phpMyAdmin as explained in the following screenshot.
Click on the required database “TEST-DB”
Select the required tables and click on the export button.
Select “Quick – display only the minimal options” i.e., default option and click on Export Button.
Determine the MySQL database table associated with your custom plugin. This information is usually available in the plugin’s documentation or configuration.
An SQL file will be saved on your local computer. Keep it as a backup.
3. Backup Scraper File
Login to the CPanel if you already are not, go to the Files section, and click on File Manager as explained in the following screenshot.
Double-click on the public_html directory and you will see the orderjourney.php file. Right-click on it and download it.
Copy or move this scraper file to a secure location for backup purposes.
Summary
By following these steps, you have successfully backed up your custom Matomo plugin, including its code, MySQL table, and associated scraper file. This ensures that you can restore your custom functionality if any issues occur during the Matomo upgrade.
Note: Ensure that the backup files are securely stored and easily accessible for quick restoration if needed.