A major difference between Independent Analytics and Google Analytics is that your data is stored on your server, not an external one.
This is great for privacy but does give you the added responsibility of safeguarding your data.
If you are not backing up your site regularly, please install a backup plugin or switch to a web host with automated backups immediately!
This will ensure you always have a backup of your analytics data, not to mention all your posts, pages, etc.
Since your analytics data is stored in your WordPress database, it’s easy to migrate and import/export using existing tools.
How to properly transfer your site’s data
As of now, Independent Analytics adds seven tables to your database, all beginning with your database prefix followed by “independent_analytics.”
Since your analytics data is stored in the WordPress database, it will be transferred by any plugin that migrates data between local/staging/production sites. This makes things easy except for when transferring from a staging site back to production.
Whenever you transfer from your staging site to your production site, you will want to exclude the tables added by Independent Analytics. Otherwise, the analytics recorded by your production site will be overwritten by the data recorded on the staging site.
Luckily, this isn’t a novel issue. Sites with dynamic data, like WooCommerce stores, have always had this requirement, so there are lots of tools available that can help.
Here are a few that we recommend.
Recommended tools
You can use any tool you want to migrate your data as long as it has the ability to include/exclude specific database tables.
We use and recommend WP Migrate, but each of these plugins allows you to migrate individual database tables between your sites:
If you don’t have a way to create a staging site already, we also recommend Blogvault and WP Stagecoach, which can create a staging site and have granular controls for migrations.
How to manually export/import your data
If you’d prefer to manually export and import your data, that is also easy to do.
How to export your analytics data
Starting by logging into your hosting dashboard and finding the link to phpMyAdmin. Once inside phpMyAdmin, click on your site’s database in the left sidebar. Then, locate the Independent Analytics tables and select them all.
Next, scroll to the bottom of the page and use the With selected dropdown to choose the Export option.
This will immediately redirect you to the Export menu, where you can click the Go button to export the selected tables.
An SQL file containing the selected tables will begin downloading right away.
How to import your analytics data
To import the data, visit the Import menu, click the Choose file button, select the SQL file you downloaded, then click the Go button to import the tables.
If your SQL file is large, it may help to compress the file before uploading. You can zip an SQL file like any other file type to compress it.
Summary
Independent Analytics adds tables to your WordPress database that are already included in any backups or migrations you perform.
This can be an issue when transferring your database from your staging site to your production site because it can cause your analytics data to get overwritten. When migrating in this way, make sure to exclude all of the Independent Analytics tables from your migration so that the production site maintains its analytics data.
We hope this answers all of your migration-related questions, but please feel free to get in touch if there is anything else you need to know.