From daf22867edb09d9167c386a688f9ee8916d1f144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=B6ster?= Date: Wed, 15 Feb 2017 19:23:34 +0100 Subject: [PATCH] Improved migration from 0.7 to 0.8 (backup of options) --- admin/class-rpr-admin-migration.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/admin/class-rpr-admin-migration.php b/admin/class-rpr-admin-migration.php index 95291de..a2048b8 100644 --- a/admin/class-rpr-admin-migration.php +++ b/admin/class-rpr-admin-migration.php @@ -139,10 +139,15 @@ public function rpr_do_migration() { * @since 0.8.0 */ private function rpr_update_from_4(){ - + + $new_options = get_option( 'rpr_options' ); $old_options = get_option( 'rpr_option' ); - // Move options to new scheme: + + // create a backup of the old options: + update_option( 'rpr_options_backup', $old_options ); + + // Move options to new scheme: // General options if( $old_options['recipe_slug'] ){ @@ -302,7 +307,7 @@ private function rpr_update_from_4(){ $new_options['advanced']['display_time'] = $old_options['recipe_time_display_in_recipe']; $new_options['advanced']['display_categories'] = $old_options['recipe_display_categories_in_recipe']; $new_options['advanced']['display_tags'] = $old_options['recipe_display_tags_in_recipe']; - + // Save the new options update_option( 'rpr_options', $new_options ); update_option( 'rpr_dbversion', 5);