Moving matomo to a different domain on the same hosted server - failed

I was running matomo on my old joomla directory - this was also a different sub domain ( as my website (

Everything is happening on the same hosted server!

As this is causing another SSL Handshake and DNS lookup (takes sometimes 0.6 seconds) i wanted to move matomo to the same directory and same domain to speed things up for my visitors and pagespeed.

So I installed the same matomo version in the web directory of In the installation process i pointed to the same (old) MYSQL Database.

I added as trusted host. i changed the tracking code in the joomla plugin to track …

But it is not working.
I can log in matomo - but i get error messages …

“Oops… there was a problem during the request. Maybe the server had a temporary issue, or maybe you requested a report with too much data…”

when trying to make system check in settings i get

" Mysqli prepare error: MySQL server has gone away"

Visits in real time are shown …

No problems when trying to reach the (same) database from the old installation though …


; <?php exit; ?> DO NOT REMOVE THIS LINE
; file automatically generated or modified by Matomo; you can manually override the default values in global.ini.php by redefining them in this file.
host = “localhost”
username = “xxxx”
password = “xxxx”
dbname = “xxx”
tables_prefix = “piwik_”
adapter = “MYSQLI”

salt = “xxx”
trusted_hosts[] = “

config.ini.php of the old installation shows different “salt”, no adapter settings, force SSL …

Any help and explanation is welcome.


I’m not too sure if this is worth the move. If your DNS lookup takes up to 0.6s, this is something you should look into. At least for my website the SSL handshake, TCP connection and DNS resolution overhead of the Matomo subdomain is 31ms, 28ms and 8ms. Also they are all only on the first request and even if they took a long time it would not slow down your website as Matomo is only starting loading once the website can be interacted with by the user.

Subdomains have their advantages as they separate Cookies (which is good for security) and make sure .htaccess rules don’t affect other applications in subdirectories.

But that is besides your point. MySQL server has gone away can have many reasons as it is caused by the connection between PHP and MySQL.

See here for some tips:

Thanks for your answers.

Interesting point with keeping the subdomain für sec reasons and seperate Cookies.

GTmetrix shows 133ms for DNS, SSL Connecting and receiving matomo.js. What takes such a long time in GTmetrix (last check: 1.8sec) is

So - there was nothing wrong with my idea that i could use the same database?