• Resolved petanovotny234

    (@petanovotny234)


    Hi,
    is there a way to export statistics?

    I have a website and in the meantime we created a new website on a subdomain. Now I want to replace the subdomain (FTP+Database) with the current website, but I would like to keep the statistics that I have on your plugin.

    How do I achieve this?

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mostafa Soufi

    (@mostafas1990)

    Hi @petanovotny234,

    Yes, you can keep your statistics! WP Statistics stores all data in custom database tables prefixed with wp_statistics_ (e.g., wp_statistics_visitor, wp_statistics_visit, wp_statistics_pages, etc.).

    Here’s how to migrate them:

    1. Export the wp_statistics_* tables from your current site’s database using phpMyAdmin or WP-CLI:
    2. In phpMyAdmin: select all tables starting with wp_statistics_, then choose Export
    3. Or via WP-CLI: wp db export --tables=$(wp db tables 'wp_statistics_*' --format=csv)
    4. Replace your main site with the subdomain (FTP + database) as planned
    5. Import the exported wp_statistics_* tables into the new database — this will restore your historical stats

    Important: Make sure the table prefix matches. If both sites use the same prefix (usually wp_), it should work seamlessly.

    Let us know if you need any help!

    Thread Starter petanovotny234

    (@petanovotny234)

    Hi,
    thanks for the response. In the end I did it more or less as you wrote – by exporting and importing the table from the database.

    It worked, thank you.

    Plugin Author Mostafa Soufi

    (@mostafas1990)

    Good to hear.

    Let me know if you need any further assistance.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.