+1-888-365-2779
Try Now
More in this section

Forums / Set-up & Installation / Purge / Delete Page History before push to Production

Purge / Delete Page History before push to Production

11 posts, 0 answered
  1. briankb
    briankb avatar
    56 posts
    Registered:
    23 Feb 2004
    31 Mar 2008
    Link to this post
    I need to purge or delete all the page history before we upload to the production server. How can we do this? We have over 50 pages so doing each page and the 20-30 history items would take too long. If there is a safe SQL query I can run that will work also.

    Reason: So the client will not see all the changes we've made since started development and mistakenly rollback.
  2. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    03 Apr 2008
    Link to this post
    Hi Briankb,

    In order to remove the history tab from the administration, you need to set the allowPageHistory attribute to False  in the web.config file as shown below:

    <providers> 
        <clear/> 
        <add connectionStringName="DefaultConnection" allowPageHistory="False" allowPageWorkflow="false" name="Sitefinity" type="Telerik.Cms.Data.DefaultProvider, Telerik.Cms.Data"/> 
    </providers> 

    This is how you will make the History tab in the Sitefinity Administration invisible. However, if you want to remove all history data from the database, this would require a complicated solution. Please let us know if this option suits your requirements or you would like us to try implementing the other solution.

    Sincerely yours,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. briankb
    briankb avatar
    56 posts
    Registered:
    23 Feb 2004
    04 Apr 2008
    Link to this post
    I need to delete the page history prior to releasing to client. They will still need to use page history.


  4. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    07 Apr 2008
    Link to this post
    Hi Briankb,

    Here is the SQL query which you requested. Please mind that after running it, all old page versions will be irreversibly deleted and only the last published one will be available:

    truncate table sf_StagedPageContent 
     
    update sf_PageContentBase 
    set version = 1 

    Hope this helps.

    Kind regards,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Craig
    Craig avatar
    8 posts
    Registered:
    16 May 2008
    04 Jun 2008
    Link to this post
    Our sitefinity project uses a large amount of images, and over the course of development we've re-uploaded many images to make changes. Our database is now sitting at about ~650mb.

    We'd love to purge the history of all items in our database - however, the above doesn't seem to work. We recieve ~138 updated rows everytime we run it - but it makes no visible changes to the history tab within sitefinity itself.

    Is there anything else we need to know?
  6. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    06 Jun 2008
    Link to this post
    Hello Craig,

    The query provided in the previous post applies only for deleting page's history. Sitefinity stores history for each single item, which can be deleted by truncating the information stored in several filegroups. Below, I am applying query which will delete these items' history, but not the items themselves:
    truncate table sf_VersionItem  
    truncate table sf_VrsBinData  
    truncate table sf_VrsLockedItems  
    truncate table sf_VrsTxtData  

    Hope that this information is helpful. Please, let us know if you have any other questions.
     
    Best wishes,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Nicko
    Nicko avatar
    16 posts
    Registered:
    10 Mar 2008
    08 Jan 2009
    Link to this post
    I've run those queries provided and it has added multiple Generic content controls to my pages? Which is sucky!

    Nicko
  8. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    10 Jan 2009
    Link to this post
    Hi Nicko,

    Have you looked over the following KB article:
    http://www.sitefinity.com/support/knowledge-base/kb-article/b1154K-baak-b1154T-cgb.aspx

    All the best,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  9. Richard
    Richard avatar
    16 posts
    Registered:
    06 May 2009
    22 Nov 2009
    Link to this post
    truncate table sf_VersionItem    
    truncate table sf_VrsBinData    
    truncate table sf_VrsLockedItems    
    truncate table sf_VrsTxtData
    truncate table sf_StagedPageContent   
       
    update sf_PageContentBase   
    set version = 1   
     
    delete from sf_StagedCtrlLinks where PageID not in (select ID from sf_StagedPageContent)  
    delete from sf_CmsCtrlLinks where PageID not in (select ID from sf_PageBase)  
    delete from sf_WebControlBase where ID not in (select ControlID from sf_CmsCtrlLinks)  
    delete from sf_CmsWebControl where ID not in (select ID from sf_WebControlBase) 

    ------------------------
    That is the complete solution above (without the shrinking of the database) to remove the version history without getting all the multiple control errors.  If you ran the inital suggestions listed in this thread you would run into editing issues, so run the above again to fix all and return to one current version.


  10. Jason Green
    Jason Green avatar
    53 posts
    Registered:
    18 Sep 2009
    26 Jun 2010
    Link to this post
    After running the above I now get an error when editing content on a page.  It appears to be an issue with shared content when editing on a page.  I get the error

    Invalid content ID specified

    When I edit the generic content and click "I'm Done"  I am able to edit the content from Modules though.

    Any idea's on how to fix it?
  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    27 Jun 2010
    Link to this post
    Hello Jason Green,

    The error says that this content item does not exists or the database data for it has been deprecated ( for the particular content item or control - shared content item relation). Try recreating the content item, remove the GenericContent control from this page, add it again and make the relation - shared content - Generic Content control by selecting the shared content item from the WebUITypeEditor.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
11 posts, 0 answered