Database missing error when upgrading to 4.1 - General Discussions - General Discussions - Progress Community
 General Discussions

Database missing error when upgrading to 4.1

  • Database missing error when upgrading to 4.1
  • 266040_sferror.jpg
    I get the attached error (screenshot) when trying to upgrade a 4.0 SP1 project. If it matters, the project was working outside of the SF Project Manager, so I installed the Project Manager to perform the upgrade. Thanks in advance.

  • Nevermind, started the upgrade over again. Got past a mismatching assembly reference by deleting ~/bin/migration.dll, and things are fine. For now. ;)
  • Now when I click on any page to edit it in the control panel, I get an "Object reference not set to an instance of an object." error with the following stack trace:

    [NullReferenceException: Object reference not set to an instance of an object.]<br>   Telerik.Sitefinity.Modules.GenericContent.ContentManager.IsContentBlockHtmlObsolete(String serverSideControlID, Guid pageId, ContentLifecycleStatus clcStatus, CultureInfo culture, String pageProviderName) +108<br>   Telerik.Sitefinity.Modules.GenericContent.ContentManager.IsContentBlockHtmlObsolete(String serverSideControlID, Guid pageId, ContentLifecycleStatus clcStatus, CultureInfo culture) +49<br>   Telerik.Sitefinity.Modules.GenericContent.ContentManager.IsContentBlockHtmlObsolete(String serverSideControlID, Guid pageId, ContentLifecycleStatus clcStatus) +94<br>   Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlock.get_IsOutDated() +347<br>   Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlock.get_CustomMessages() +315<br>   Telerik.Sitefinity.Web.UI.ZoneEditor.CustomizeControlDockTitlebar(Control control, RadDock dock) +163<br>   Telerik.Sitefinity.Web.UI.ZoneEditor.AddControlDocksToZone(String placeHolderId, Control zone) +167<br>   Telerik.Sitefinity.Web.UI.ZoneEditor.ProcessPlaceholders() +131<br>   Telerik.Sitefinity.Web.UI.ZoneEditor.CreateChildControls() +88<br>   System.Web.UI.Control.EnsureChildControls() +181<br>   System.Web.UI.Control.PreRenderRecursiveInternal() +59<br>   System.Web.UI.Control.PreRenderRecursiveInternal() +221<br>   System.Web.UI.Control.PreRenderRecursiveInternal() +221<br>   System.Web.UI.Control.PreRenderRecursiveInternal() +221<br>   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4184

  • Hello Eric,

    There is an issue with upgrade of content blocks in Page Templates.

    To fix this, please run the query below against your DB and check if the issue still exists. The script will fix the error and remove the option to share the content block while it is used in a template.
    NOTE: Backup your database before you run the script.

    UPDATE[sf_object_data]
       SET[sf_object_data].object_type = 'Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlockBase'
       FROM[sf_object_data] INNERJOIN[sf_page_templates] ON[sf_object_data].page_id = [sf_page_templates].id
       WHEREobject_type = 'Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlock'
       GO
           
       UPDATE[sf_object_data] SET[sf_object_data].object_type = 'Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlockBase'
       WHEREoriginal_control_id in(SELECT[sf_object_data].id
                                     FROM[sf_object_data] INNERJOIN[sf_page_templates] ON[sf_object_data].page_id = [sf_page_templates].id
                                     WHEREobject_type = 'Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlockBase') AND
             object_type = 'Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlock'
       GO


    Let me know how it goes. Once again, use a backup of the database

    Best wishes,
    Ivan Dimitrov
    the Telerik team

  • I'm not able to get it to run. Is it a problem that my database is an MDF in the App_Data folder? VS2010 keeps giving me a syntax error.
  • VS2010 doesn't seem to like the "GO" so I took them out and ran them as two separate queries, one after the other. Each one said "0 rows affected...".
  • Checking in to see if anyone's had a chance to look at this.
  • Hi Eric ,

    You can attach the mdf to the sql server and then create a backup.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • I am having the same issue.

    Running the SQL script above does not resolve this issue.
  • Hello ,

    This error occurs because of the new shared content block behaviour. It has been resolved in 4.1 SP1 that is due to be released today (Friday). Some of your ContentBlock controls have no IDs (the ID property is deleted). That breaks Page Editor. As a workaround, you could run the following code which will set unique IDs for all ContentBlocks:

    Again, use database backup if you are not intending to upgrade to the 4.1 SP1.

    var manager = PageManager.GetManager();
    var controlType = typeof(ContentBlock).FullName;
    var propName = "ID";   
      
    var controls = manager.GetControls<PageControl>().Where(pc => pc.ObjectType == controlType);
    foreach (var cb in controls)
        var idProp = cb.Properties.FirstOrDefault(p => p.Name == propName);
        if (idProp == null)
        
            idProp = manager.CreateProperty();
            idProp.Name = propName;
            idProp.Value = Guid.NewGuid().ToString();
            cb.Properties.Add(idProp);
        
      
    var draftControls = manager.GetControls<PageDraftControl>().Where(pdc => pdc.ObjectType == controlType);
    foreach (var cb in draftControls)
        var idProp = cb.Properties.FirstOrDefault(p => p.Name == propName);
        if (idProp == null)
        
            idProp = manager.CreateProperty();
            idProp.Name = propName;
            idProp.Value = Guid.NewGuid().ToString();
            cb.Properties.Add(idProp);
        
      
    manager.SaveChanges();


    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • I'm also having the issue noted above. Was there a resolution? Bear in mind I'm on 4.1 SP2 so I suspect it's not the same underlying issue.
  • Hello Alex,

    As mentioned above can you confirm your database is an .mdf file. If it is it is stored in Sitefinity App_Data folder which has different security than the rest of the folders in the site root. Can you make sure you grant the folder full permissions so the upgrade procedure can update the database.

    Greetings,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • It wasn't an upgrade, it was built using 4.1 SP2. I fixed it by manually attaching the mdf and ldf and then updating the web.config

    This is a site that has been moved from the dev server to a testing server so I believe that is the proper procedure?

    Alex.
  • Hello Alex,

    Can you confirm you have permissions to read write and modify App_Data folder, because it seems Sitefinity can not access the folder. Also make sure you run the application in Full trust environment.

    Kind regards,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items