To move Matomo (Piwik) from one server to another, you need to move all the Matomo files (the whole directory containing Matomo files), as well as the database to another MySQL server.

Often when you want to migrate one or more websites from one Matomo (Piwik) instance to another, the easiest solution is to use the SiteMigration plugin.

In case you want to migrate the complete Matomo (Piwik) service and database to another server, follow these steps:

  • Export your mysql database in a file; you can use tools such as phpmyadmin or mysqldump to do this.
  • Note that if you are not deleting your old visitor logs, then you do not need to backup the piwik_archive_* tables, as they would be automatically re-created and processed from the other piwik tables.
  • Import the backed up database in your new server; you can use phpmyadmin to import the file that you previously created. This should create more than a dozen Matomo (Piwik) tables in your database.
  • Install Matomo (Piwik) in your new server; it is important that you install the exact same version as the one you are currently using. During the installation process, you will be asked to provide the mysql server, login, password and table prefix. Specify the same table prefix (by default, “piwik_”). Matomo will detect that the tables are present in the database and all your existing websites and reports will be automatically detected. It will only work if you re-install the exact same version – see Which version of Matomo I use?, and download the right version from the builds.piwik.org server
  • If the Matomo (Piwik) domain name has changed, you also need to change the Matomo javascript tags on all your tracked pages. For example, if Matomo was installed in piwik.example.org and you now installed it in piwik.example-different.com or example.org/piwik, you need to update the tags on all your websites’ pages.
  • If you use the auto archiving cron, you will have to setup the cron script on the new server.

Note that during the operation, visits will not be tracked.

Any questions?

Many answers and more information about Matomo you can find here:

We are social

Follow us: