Mobile app version of vmapp.org
Login or Join
Heady270

: Migrate Piwik Data I currently have Piwik installed on analytics.myhost.com with lots of data. This has been live for over a year so I would like to keep all of my stats. I have moved hosts

@Heady270

Posted in: #Matomo #Sql

I currently have Piwik installed on analytics.myhost.com with lots of data. This has been live for over a year so I would like to keep all of my stats.

I have moved hosts now therefore also need to move my Piwik data. So far I have installed a new version on Piwik on mydomain.com/analytics This works as expected, no data so far, fresh new install, but working fine.

Can I move my old Piwik data to my new Piwik installation, if so - how? Is it just a matter of exporting my old Piwik DB and importing this to my new Piwik DB, overwriting old data?

Not sure if I should have imported the old DB first then ran the Piwik installer, or will it just pick up my new data if I overwrite what's there now.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Heady270

2 Comments

Sorted by latest first Latest Oldest Best

 

@Annie201

The simplest way to migrate the data between two hosts would be with phpmyadmin.

On your old site login to phpmyadmin select the database on the left menu.

On the Export tab leave all the settings as they are and download the .sql file

Login to the new website through phpmyadmin (assuming you've created a db/user) click the database on the left menu and now import the .sql file.

Upload all your old Piwik files to the new server. Do this because if you've install the latest version of Piwik it may rely on an old database table no longer in your exported file. So work with all the same files from your old site.

Update the db, user, and pass for Piwiks db connection.

Adjust the tracking URL if needed unless it's the same.

With Piwik up and running again now you can go through the standard method to upgrade the software.

10% popularity Vote Up Vote Down


 

@Ann8826881

Here are two links from the manuals:

How can I reinstall Piwik? Can I keep the existing data?

How can I move Piwik from one server to another, also migrating the data from one mysql server to another?

I suspect that this should be enough unless you need help with MySQL:

How To Migrate a MySQL Database Between Two Servers

You can ignore the copy method used on this page and use FTP (text not binary) or any other copy method that you have available that preserves the text file.

If you have port 3306 access to your MySQL install(s), you can use MySQL Workbench which can be downloaded here:

Download MySQL Workbench

I strongly caution you to make several dumps of your database before trying to copy either using the command line of GUI. Sometimes, something will go wrong and not allow all of the data to be imported.

You can fine the Workbench documentation here:

MySQL Documentation: MySQL Workbench

This takes a bit to get started, but not much. I always recommend using the GUI if you can. The reason is simple. You do not have to know all the command line options, the GUI will often default to the options you need.

I hope that is enough to get you started. If you run into trouble, let us know and I can either update the answer, or anyone can help you in the comments or provide a new answer.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme