Error in UI-path when upgrading from EPiServer 5 to 6

The other day we were upgrading a site for a customer from EPiServer 5 to EPiServer 6. In the upgrade process an exception was thrown telling us: At C:\Program Files (x86)\EPiServer\CMS\6.0.530.0\Upgrade\System Scripts\Upgrade Site (SqlServer).ps1:361 char:29 +                  $newUiUrl = $uiUrl.Replace <<<< ($uiPath, $uiPath+”/CMS”) System.Management.Automation.ParentContainsErrorRecordException: Cannot convert argument “1”, with value: “/CMS”, for “Replace” to type …