diff --git a/mail/e-mail-migrate.c b/mail/e-mail-migrate.c
index 10afa58..536d436 100644
--- a/mail/e-mail-migrate.c
+++ b/mail/e-mail-migrate.c
@@ -1351,10 +1351,18 @@ em_rename_camel_url_params (CamelURL *url)
 }
 
 static void
-em_rename_account_params (void)
+em_rename_account_params (EShellBackend *shell_backend)
 {
 	EAccountList *account_list;
 	EIterator *iterator;
+	EMailBackend *mail_backend;
+	const gchar *data_dir;
+
+	mail_backend = E_MAIL_BACKEND (shell_backend);
+	data_dir = e_shell_backend_get_data_dir (shell_backend);
+
+	/* Initialize the mail stores early, thus it's ready for changes. */
+	e_mail_store_init (mail_backend, data_dir);
 
 	/* XXX As of 3.2, CamelServices store settings in GObject properties,
 	 *     not CamelURL parameters.  CamelURL parameters are still used
@@ -1554,7 +1562,7 @@ e_mail_migrate (EShellBackend *shell_backend,
 
 	/* Rename account URL parameters to
 	 * match CamelSettings property names. */
-	em_rename_account_params ();
+	em_rename_account_params (shell_backend);
 
 	if (!migrate_local_store (shell_backend))
 		return FALSE;
