diff --git a/util/MsSql/entrypoint.sh b/util/MsSql/entrypoint.sh index 141320059d..309bf4d0ed 100644 --- a/util/MsSql/entrypoint.sh +++ b/util/MsSql/entrypoint.sh @@ -43,8 +43,8 @@ fi # Replace database name in backup-db.sql if [ ! -z "$DATABASE" ] then - sed -i -e "/@DatabaseName /s/vault/$DATABASE/" backup-db.sql - sed -i -e "/@DatabaseNameSafe /s/vault/${DATABASE// /-}/" backup-db.sql + sed -i "/^SET @DatabaseName =/s/'[^']*'/'$DATABASE'/" backup-db.sql + sed -i "/^SET @DatabaseNameSafe =/s/'[^']*'/'${DATABASE// /-}'/" backup-db.sql fi # The rest... diff --git a/util/Setup/EnvironmentFileBuilder.cs b/util/Setup/EnvironmentFileBuilder.cs index 1a5fc308f5..bba4180858 100644 --- a/util/Setup/EnvironmentFileBuilder.cs +++ b/util/Setup/EnvironmentFileBuilder.cs @@ -104,6 +104,7 @@ public class EnvironmentFileBuilder _mssqlOverrideValues = new Dictionary { ["SA_PASSWORD"] = dbPassword, + ["DATABASE"] = _context.Install?.Database ?? "vault" }; _keyConnectorOverrideValues = new Dictionary