Migrate Piwik from one database to another and to a different Matomo version


We are currently using Piwik 2. I would like to know if we can move all the data to a new server and to a new version. In this FAQ it is mentioned that I should make the migration using the same version. Is it possible to use a different Matomo version since our current version is very old?

Also, the Matomo will be using a different domain.

Edit: I should mention that we are considering of keeping all the existing data and the current users, access rights and siteIds.

(Lukas Winkler) #2


If you are also migrating the config.ini.php and are using the new files on the new server it should work just like a normal manual update.

So make a backup to be save, but it should work.



Could you please be a bit more detailed about the procedure? If I make a Matomo 3.9.1 installation in the new server, move all the tables from the old database to the new database, and use that new database (containing all Piwik 2 logs) for the new installation, will it just work fine?

What happens to the naming of the tables, from example piwik -> matomo in the tables names etc?

(Lukas Winkler) #4


You don’t need to actually go through the installation setup on the new server as it only creates the config file (that you already have).

You probably need to update the MySQL details in the config file as the new server has a new user/password.

The table prefix doesn’t matter as it is specified in the config file and only the default for new installs changed to matomo_


So I should just move Piwik database to a new database and use that new database with the latest Matomo version with no complications? Just changing the database parameters in the config.ini.php file?

Then why is it mentioned in the FAQ that Matomo should have the same version when moving to a different server?

(Lukas Winkler) #6

If you don’t copy over the config file, you can regenerate it by going through the installer again and Matomo detects the existing data.

But this only works if the database and the files are of the same version.


I have already generated my desired config file for the latest matomo version. But the database is empty for now and I need to migrate all the data to the new database. However I was concerned that Matomo might not work/would not recognise with the old database tables etc due to conflicts. If there are no conflicts then I will migrate this way.