Knowledge is power. We love to share it.

News related to Mono products, services and latest developments in our community.

khorvat

MonoX CMS upgrade guidelines (v4.9 to v5.1)

01/23/2015Categories: MonoX, ASP.NET
We have recently released MonoX v5.1. It brought major infrastructural changes related to module, service (BLL) and repository IoC/DI (Inversion of Control/Dependency Injection). These major changes introduced new BLL, repository and various other classes which must be used in order for v5.1 and above to work properly. There are also a few breaking changes that needs to be fixed in order to safely upgrade your application.

Here is how you should upgrade your existing MonoX installation.

Prerequisites 

Steps

  • Run the database upgrade scripts in their numeric order (they can be found here "\MonoX\Installer\Sql\UpgradeScripts\5.1.40.5027\*.sql").
    Note: Localization SQL files need special attention.
    • If you haven't added any new localization settings to the database, you can delete records form the tables LocalizationSource, LocalizationString and LocalizationBinary and then import new SQL - otherwise the differences will need to be resolved manually.
      • LocalizationSource.sql "\MonoX\Installer\Sql\import\LocalizationSource.sql"
      • LocalizationString.sql  "\MonoX\Installer\Sql\import\LocalizationString.sql"
      • LocalizationBinary.sql  "\MonoX\Installer\Sql\import\LocalizationBinary.sql"
  • Apply the code patch (MonoX_Patch_4_9_40_4907_40_to_5_1_40_5065_40.zip)
    • You need to synchronize the following files manually (*.htm, *.aspx and *.ascx files):
    • List of modified files
      • BlogPost.ascx
      • AdminFooter.ascx
      • AdminHeader.ascx
      • MonoXRating.ascx
      • PageFooter.ascx
      • BlogList.ascx
      • BlogPostEdit.ascx
      • Confirmation.ascx
      • Comments.ascx
      • EditProfile.ascx
      • UserAvatar.ascx
      • WallNotes.ascx
      • UserProfileHeader.ascx
      • SilverlightUploadModule.ascx
      • SlideShow.ascx
      • BlockedUserList.ascx
      • DiscussionBoard.ascx
      • DiscussionMessages.ascx
      • DiscussionTopics.ascx
      • MessageCreate.ascx
      • MessageDetails.ascx
      • MessageList.ascx
      • PeopleSearch.ascx
      • PhotoUpload.ascx
      • WallNotes.ascx
      • TwoColumnsTemplate.aspx
      • Default.aspx
      • Login.aspx
      • ActivationEmailRecovery.aspx
      • PasswordRecovery.aspx
      • Register.aspx
      • AdManager.aspx
      • Default.aspx
      • FileAdminAmazonS3.aspx
      • NewsManager.aspx
      • PageAdmin.aspx
      • PortalLocalization.aspx
      • SnGroupMembershipManager.aspx
      • UserManager.aspx
      • AccountActivation.aspx
      • ActivationEmailRecovery.aspx
      • Blog.aspx
      • Content.aspx
      • Default.aspx
      • Friends.aspx
      • Login.aspx
      • MobileMessage.aspx
      • PasswordRecovery.aspx
      • Register.aspx
      • UserProfile.aspx
      • Wall.aspx
      • AdditionalResources.aspx
      • Features.aspx
      • Error.aspx
      • Message.aspx
      • NotFound.aspx
      • MyWall.aspx
      • BlogListShort.htm
      • AddThisCode.htm
      • AddThisCodeSharecount.htm

      Note: If you haven't modified any of these files in your project, they can be safely overwritten.

    • Update/sync web.config (We recommend the tool like WinMerge to see all the changes).

Breaking Changes

  • SilverlightUploadModule has been replaced with HTML5Upload site-wide. This is a drop-in replacement, only the markup was changed. SilverlightUploadModule will still work if you use it elsewhere.
  • MonoX DAL is upgraded to LLBLGen version 4.1. The latest package is available on GitHub.
    • Here are new configuration sections that need to be added: <section name="sqlServerCatalogNameOverwrites" type="System.Configuration.NameValueSectionHandler"/>
    • sqlServerCatalogNameOverwrites configuration: <sqlServerCatalogNameOverwrites><add key="*" value="" /></sqlServerCatalogNameOverwrites>
  • Change the "MonoSoftware.MonoX.Blog.Gravatar.GravatarType.Avatar" to "MonoSoftware.MonoX.Blog.GravatarType.Avatar"
  • Change ParentEntityType="<%$ Code: MonoSoftware.MonoX.Utilities.SnEntityType.Message %>" to ParentEntityType="<%$ Code: Convert.ToInt32(MonoSoftware.MonoX.Utilities.SnEntityType.Message) %>" 
  • Required code changes related to DI Ninject container (Note: All repositories now have an interface through which they are resolved.)
    • Naming changes
    • Old pattern for repository calls:
      RepositoryNameRepository.GetInstance().MethodName()
      BLLNameBLL.GetInstance().MethodName()

      New pattern for repository calls:
      DependencyInjectionFactory.Resolve<IRepositoryNameRepository>().MethodName();
      DependencyInjectionFactory.Resolve<IBLLNameBLL>().MethodName();

    • if DependencyInjectionFactory is not available you will have to use ResolveWithoutContext DIFactory.ResolveWithoutContext<IRepositoryNameRepository>().MethodName();
    • It's preferred to use BLL interface instead of calling repository directly in all Pages, WebControls and UserControls. All methods available in the repository should be reflected in the BLL.
    • Here is a sample code illustrating the usage of BLL:

Old:
EntityCollection<BlogEntity> blogs = BlogRepository.GetInstance().GetBlogs(e.Text, 50);
New:
EntityCollection<BlogEntity> blogs = DependencyInjectionFactory.Resolve<IBlogBLL>().GetBlogs(e.Text, 50);

If you have any issues while upgrading, you should report them to our support forum.

Please send your feedback and feature requests to our Roadmap forum.

Rated 4.67, 3 vote(s). 
super
By super
Thank you khorvat for the upgrade guide. I will test it at some point and will report back the results.

This guide should be helpful to many monox users.
By JoeyB
Thanks for the guide.

Will this also work with the "Web App Gallery" version on MonoX to support an upgrade for Azure Websites? are you planning a 5.1 release of MonoX in the "Web App Gallery"?