One of the biggest fears users have when upgrading from a FREE WordPress plugin to its PRO version? “Will I lose all my settings?”
If your plugin doesn’t handle this gracefully, that fear becomes a hard “no” — and a lost sale.
But with a thoughtful migration strategy, you can turn that fear into confidence. Here’s how to ensure zero data loss when users switch from FREE to PRO. ✅ Step 1: Use a Consistent Option Key
Store all settings under a single, predictable option name — and keep it the same in both versions.
// In both FREE and PRO
$settings = get_option('sws_appointment_settings', []);
This way, the PRO version can read the FREE settings immediately on activation. ✅ Step 2: Auto-Detect and Migrate on PRO Activation
When the PRO plugin is activated, check if FREE settings exist — and copy them.
// In your PRO plugin activation hook
function sws_pro_migrate_from_free() {
// Only run once
if (get_option('sws_pro_migrated_from_free')) {
return;
}
$free_settings = get_option('sws_appointment_settings', null);
if ($free_settings !== null) {
// Optionally transform data if PRO uses a new structure
$pro_settings = sws_convert_free_to_pro_format($free_settings);
update_option('sws_appointment_settings', $pro_settings);
update_option('sws_pro_migrated_from_free', true);
}
}
register_activation_hook(__FILE__, 'sws_pro_migrate_from_free');
Note: Always add a flag (sws_pro_migrated_from_free) to avoid re-running the migration.
✅ Step 3: Ask for Confirmation (Optional but Recommended)
Give users control. On first PRO admin page load, show a notice:
“We found settings from the FREE version. Would you like to keep them?”
function sws_pro_show_migration_notice() {
if (!get_option('sws_pro_migrated_from_free') && get_option('sws_appointment_settings')) {
echo '
Even after migration, don’t delete the FREE plugin’s data unless the user uninstalls it. Why? They might deactivate PRO temporarily — and you don’t want them to lose everything.
Only clean up on uninstall, using register_uninstall_hook.
✅ Final Checklist for Safe Migration
Same option key in FREE and PRO
Migration runs only once (flag-based)
Users can trigger or skip migration
FREE data is preserved until explicit uninstall
Clear documentation: “Your settings are safe!”
✅ Final Thought
A smooth upgrade path isn’t just a technical detail — it’s a powerful sales argument.
When users know their work won’t be erased, they’re far more likely to invest in your PRO version.
And that’s how you turn free users into loyal customers.
Built with care at SWSPlugins.com — where every plugin respects your work.