diff --git a/src/Umbraco.Core/IRuntimeState.cs b/src/Umbraco.Core/IRuntimeState.cs
index 5c0c01ef3b..5fcfab1518 100644
--- a/src/Umbraco.Core/IRuntimeState.cs
+++ b/src/Umbraco.Core/IRuntimeState.cs
@@ -57,6 +57,16 @@ namespace Umbraco.Core
///
RuntimeLevel Level { get; }
+ ///
+ /// Gets the current migration state.
+ ///
+ string CurrentMigrationState { get; }
+
+ ///
+ /// Gets the final migration state.
+ ///
+ string FinalMigrationState { get; }
+
///
/// Gets the exception that caused the boot to fail.
///
diff --git a/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs b/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs
index db3b918241..f8cd4b0f78 100644
--- a/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs
+++ b/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs
@@ -112,7 +112,7 @@ namespace Umbraco.Core.Migrations.Upgrade
Chain("{8640C9E4-A1C0-4C59-99BB-609B4E604981}");
Chain("{DD1B99AF-8106-4E00-BAC7-A43003EA07F8}");
Chain("{9DF05B77-11D1-475C-A00A-B656AF7E0908}");
- Chain("{CA7DB949-3EF4-403D-8464-F9BA36A52E87}");
+ Chain("{6FE3EF34-44A0-4992-B379-B40BC4EF1C4D}");
Chain("{7F59355A-0EC9-4438-8157-EB517E6D2727}");
// must chain to v8 final state (see at end of file)
diff --git a/src/Umbraco.Core/Runtime/CoreRuntime.cs b/src/Umbraco.Core/Runtime/CoreRuntime.cs
index 7d28ffcf57..44d7ad3f68 100644
--- a/src/Umbraco.Core/Runtime/CoreRuntime.cs
+++ b/src/Umbraco.Core/Runtime/CoreRuntime.cs
@@ -138,7 +138,7 @@ namespace Umbraco.Core.Runtime
try
{
var dbfactory = container.GetInstance();
- SetRuntimeStateLevel(_state, dbfactory, Logger);
+ SetRuntimeStateLevel(dbfactory, Logger);
Logger.Debug($"Runtime level: {_state.Level}");
}
catch
@@ -233,38 +233,38 @@ namespace Umbraco.Core.Runtime
builder.AddCore();
}
- private void SetRuntimeStateLevel(RuntimeState runtimeState, IUmbracoDatabaseFactory databaseFactory, ILogger logger)
+ private void SetRuntimeStateLevel(IUmbracoDatabaseFactory databaseFactory, ILogger logger)
{
var localVersion = UmbracoVersion.Local; // the local, files, version
- var codeVersion = runtimeState.SemanticVersion; // the executing code version
+ var codeVersion = _state.SemanticVersion; // the executing code version
var connect = false;
// we don't know yet
- runtimeState.Level = RuntimeLevel.Unknown;
+ _state.Level = RuntimeLevel.Unknown;
if (localVersion == null)
{
// there is no local version, we are not installed
logger.Debug("No local version, need to install Umbraco.");
- runtimeState.Level = RuntimeLevel.Install;
+ _state.Level = RuntimeLevel.Install;
}
else if (localVersion != codeVersion)
{
// there *is* a local version, but it does not match the code version
// need to upgrade
logger.Debug($"Local version \"{localVersion}\" != code version \"{codeVersion}\", need to upgrade Umbraco.");
- runtimeState.Level = RuntimeLevel.Upgrade;
+ _state.Level = RuntimeLevel.Upgrade;
}
else if (databaseFactory.Configured == false)
{
// local version *does* match code version, but the database is not configured
// install (again? this is a weird situation...)
logger.Debug("Database is not configured, need to install Umbraco.");
- runtimeState.Level = RuntimeLevel.Install;
+ _state.Level = RuntimeLevel.Install;
}
// install? not going to test anything else
- if (runtimeState.Level == RuntimeLevel.Install)
+ if (_state.Level == RuntimeLevel.Install)
return;
// else, keep going,
@@ -284,14 +284,14 @@ namespace Umbraco.Core.Runtime
{
// cannot connect to configured database, this is bad, fail
logger.Debug("Could not connect to database.");
- runtimeState.Level = RuntimeLevel.BootFailed;
+ _state.Level = RuntimeLevel.BootFailed;
// in fact, this is bad enough that we want to throw
throw new BootFailedException("A connection string is configured but Umbraco could not connect to the database.");
}
// if we already know we want to upgrade, no need to look for migrations...
- if (runtimeState.Level == RuntimeLevel.Upgrade)
+ if (_state.Level == RuntimeLevel.Upgrade)
return;
// else
@@ -302,18 +302,19 @@ namespace Umbraco.Core.Runtime
{
exists = EnsureUmbracoUpgradeState(databaseFactory, logger);
}
- catch
+ catch (Exception e)
{
// can connect to the database but cannot access the migration table... need to install
+ logger.Warn(e, "Could not check the upgrade state.");
logger.Debug("Could not check the upgrade state, need to install Umbraco.");
- runtimeState.Level = RuntimeLevel.Install;
+ _state.Level = RuntimeLevel.Install;
return;
}
if (exists)
{
// the database version matches the code & files version, all clear, can run
- runtimeState.Level = RuntimeLevel.Run;
+ _state.Level = RuntimeLevel.Run;
return;
}
@@ -323,7 +324,7 @@ namespace Umbraco.Core.Runtime
// although the files version matches the code version, the database version does not
// which means the local files have been upgraded but not the database - need to upgrade
logger.Debug("Has not reached the final upgrade step, need to upgrade Umbraco.");
- runtimeState.Level = RuntimeLevel.Upgrade;
+ _state.Level = RuntimeLevel.Upgrade;
}
protected virtual bool EnsureUmbracoUpgradeState(IUmbracoDatabaseFactory databaseFactory, ILogger logger)
@@ -343,11 +344,12 @@ namespace Umbraco.Core.Runtime
state = database.FirstOrDefault(sql)?.Value;
}
- var finalState = umbracoPlan.FinalState;
+ _state.CurrentMigrationState = state;
+ _state.FinalMigrationState = umbracoPlan.FinalState;
- logger.Debug($"Final upgrade state is \"{finalState}\", database contains \"{state ?? ""}\".");
+ logger.Debug($"Final upgrade state is \"{_state.FinalMigrationState}\", database contains \"{state ?? ""}\".");
- return state == finalState;
+ return state == _state.FinalMigrationState;
}
#region Locals
diff --git a/src/Umbraco.Core/RuntimeState.cs b/src/Umbraco.Core/RuntimeState.cs
index 3c3ebdbd84..d740352649 100644
--- a/src/Umbraco.Core/RuntimeState.cs
+++ b/src/Umbraco.Core/RuntimeState.cs
@@ -85,6 +85,12 @@ namespace Umbraco.Core
/// This is either "/" or eg "/virtual".
public string ApplicationVirtualPath { get; } = HttpRuntime.AppDomainAppVirtualPath;
+ ///
+ public string CurrentMigrationState { get; internal set; }
+
+ ///
+ public string FinalMigrationState { get; internal set; }
+
///
/// Gets the runtime level of execution.
///
diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/upgrade.html b/src/Umbraco.Web.UI.Client/src/installer/steps/upgrade.html
index 4edf2eda25..472ceb7135 100644
--- a/src/Umbraco.Web.UI.Client/src/installer/steps/upgrade.html
+++ b/src/Umbraco.Web.UI.Client/src/installer/steps/upgrade.html
@@ -1,18 +1,19 @@
Upgrading Umbraco
- Welcome to the Umbraco installer. You see this screen because your Umbraco installation needs a quick upgrade of its database and files, which will ensure your website is kept as fast, secure and up to date as possible.
+ Welcome to the Umbraco installer. You see this screen because your Umbraco installation needs a quick upgrade
+ of its database and files, which will ensure your website is kept as fast, secure and up to date as possible.
-
- To read a report of changes between your current version {{installer.current.model.currentVersion}} and this version you're upgrading to {{installer.current.model.newVersion}}
+ Detected current version {{installer.current.model.currentVersion}} ({{installer.current.model.currentState}}),
+ which needs to be upgraded to {{installer.current.model.newVersion}} ({{installer.current.model.newState}}).
+ To compare versions and read a report of changes between versions, use the View Report button below.