Backing up or migrating your affiliate data is an essential step when transferring your website to a new server, making significant updates, or simply safeguarding your information. In this guide, we’ll cover the best practices and tools for securely backing up and migrating affiliate data.
Methods for Backing Up or Migrating Affiliate Data
Export and Import Your MySQL Database
The most direct method to back up or migrate affiliate data is through your MySQL database. Tools like phpMyAdmin allow you to export and import your database easily. Follow the steps outlined in WordPress.org’s Moving WordPress guide for detailed instructions.
Handling Campaigns Data During Export
When performing a MySQL dump, you may encounter the error:#1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation
This error is caused by the wp_affiliate_wp_campaigns
table, which is actually a view rather than a standard table. To resolve this:
- Exclude the
wp_affiliate_wp_campaigns
table from your export. - The campaigns view is automatically generated from the
referrals
andvisits
tables, so excluding it will not impact your data integrity.
If you wish to re-enable the campaigns view after migrating, ensure your MySQL user has the CREATE VIEW privilege. You can refer to MySQL’s Privileges Documentation for further details.
Using WordPress Backup and Migration Plugins
For a more user-friendly approach, consider using one of the following plugins to back up or migrate your affiliate data and other site information:
- Duplicator: A powerful plugin that creates a complete copy of your WordPress site, including AffiliateWP data, for migration or backup purposes.
- WP Migrate DB: Specifically useful for migrating databases with search and replace functionality.
Best Practices for Backups and Migrations
- Ensure you back up your affiliate data regularly to avoid data loss during updates or migrations.
- Before initiating a migration, test the backup to ensure all necessary data, including affiliate information, has been captured correctly.
- Remember to exclude the
wp_affiliate_wp_campaigns
view during export if you encounter errors. This will not affect your campaign data as it is dynamically created from thereferrals
andvisits
tables. - Opt for well-supported plugins like Duplicator to streamline the process. These plugins often handle common issues like serialized data, ensuring a seamless migration.
That’s it! Backing up and migrating affiliate data is straightforward with tools like phpMyAdmin or plugins like Duplicator. By following best practices and ensuring you account for database-specific nuances like the campaigns view, you can safeguard your affiliate program during any changes to your website infrastructure.