+ gchar *pathname;
+ GKeyFile *keyfile_def = NULL;
+ GKeyFile *keyfile = NULL;
+ GError *error = NULL;
+ connman_bool_t delete_old_config = TRUE;
+ char **services, **keys, *value;
+ int i, k, err;
+ connman_bool_t val;
+
+ pathname = g_strdup_printf("%s/%s", STORAGEDIR, DEFAULT);
+ if (pathname == NULL)
+ return;
+
+ /* If setting file exists, migration has been done. */
+ keyfile = __connman_storage_load_global();
+ if (keyfile) {
+ g_key_file_free(keyfile);
+ unlink(pathname);
+ g_free(pathname);
+ return;
+ }
+
+ /* If default.profile exists, create new settings file */
+ keyfile_def = storage_load(pathname);
+ if (keyfile_def == NULL)
+ goto done;
+
+ services = g_key_file_get_groups(keyfile_def, NULL);
+ for (i = 0; services != NULL && services[i] != NULL; i++) {
+ if (strncmp(services[i], "wifi_", 5) != 0 &&
+ strncmp(services[i], "ethernet_", 9) != 0 &&
+ strncmp(services[i], "cellular_", 9) != 0 &&
+ strncmp(services[i], "bluetooth_", 10) != 0 &&
+ strncmp(services[i], "wimax_", 6) != 0 &&
+ strncmp(services[i], "vpn_", 4) != 0)
+ continue;
+
+ keyfile = connman_storage_load_service(services[i]);
+ if (keyfile != NULL) {
+ g_key_file_free(keyfile);
+ DBG("already exists %s", services[i]);
+ continue;
+ }