2

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.

2

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.

  • Thanks Anagio that's perfect! I am currently tracking four websites in Piwik, but when I migrate I only want to rack one, so I'll delete the three once I migrate the db. – jonboy Jul 4 '14 at 15:25
3

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.

  • Thanks you very much closetnoc, very good answer. I have never used MySQL workbench, can I just ask - would using PhpMyAdmin be the same thing, I am more familiar with this app. – jonboy Jul 4 '14 at 8:44
  • Yes. PhpMyAdmin is excellent. I just do not like having it installed on a publicly available server for security reasons. – closetnoc Jul 4 '14 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.