What Refactor Database Structure Does
This action copies the database update SQL file for your current app version to your site root. The file is named database_update_X.X.X.sql (where X.X.X is your version). Use it after upgrading AffiliatePro when the upgrade notes tell you to run database migrations. You then run the SQL file manually (e.g. via phpMyAdmin or command line) to apply the schema changes.
Step-by-Step: Refactor Database Structure
- In the top navigation bar, click Settings.
- In the dropdown that opens, click Add-Ons.
- On the Add-Ons page, scroll to the System Settings section.
- Find the Backups card and click Go to Module.
- On the Backup Panel page, look at the top-right card labeled Reset All Data.
- Click the blue Refactor Database Structure button.
- The action runs immediately. It copies the version-specific SQL file from
application/backup/database_update_X.X.X.sqlto your site root. - You then run that SQL file manually via phpMyAdmin (Import) or the MySQL command line to apply the schema updates. Follow the upgrade instructions for your specific version.
When to Use It
- After upgrading AffiliatePro and the changelog or upgrade guide says to run database migrations.
- When you see errors related to missing tables or columns after an update.
Before You Refactor
- Create a database backup first. Schema changes can affect data.
- Follow the version-specific upgrade instructions. Some versions may require manual SQL execution.
If the Update File Does Not Exist
If the SQL file for your version is not present, you will see an error (e.g. Database update file does not exist). In that case, the upgrade package may not include migrations, or you may need to obtain the correct update file from the developer.
Demo Mode
Refactor Database Structure is disabled when the site is in demo mode.