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

Forums / Developing with Sitefinity / Run Multiple Community Editon Sites from one SQL2009 Database?

Run Multiple Community Editon Sites from one SQL2009 Database?

42 posts, 0 answered
  1. Brook
    Brook avatar
    14 posts
    Registered:
    27 Oct 2009
    24 Apr 2009
    Link to this post
    Off the wall question, but can we run multiple Community version 3.6 sp1 sites off one SQL2009 database?  If yes, what do we need to do to accomplish this (change the application id in web config or )?  Is this recommended?

    Brook
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    24 Apr 2009
    Link to this post
    Hello Brook,

    You can have multiple instances of Sitefinity running on the same database. There are two options

    1. Shared projects - they will have the same application name for each provider
    2. Not shared - different application names for each provider as well as for the pages

    website one:

            <cms defaultProvider="Sitefinity" redirectToHomePage="false" pageExtension=".aspx" disabled="false" pageEditorUIMode="Overlay"
                <providers> 
                    <clear /> 
                    <add connectionStringName="DefaultConnection" allowPageHistory="true" allowPageWorkflow="false" cachingProviderName="ASPNET" name="Sitefinity" type="Telerik.Cms.Data.DefaultProvider, Telerik.Cms.Data" applicationName="/websiteone" /> 
                </providers> 

    website two:

            <cms defaultProvider="Sitefinity" redirectToHomePage="false" pageExtension=".aspx" disabled="false" pageEditorUIMode="Overlay">  
                <providers>  
                    <clear />  
                    <add connectionStringName="DefaultConnection" allowPageHistory="true" allowPageWorkflow="false" cachingProviderName="ASPNET" name="Sitefinity" type="Telerik.Cms.Data.DefaultProvider, Telerik.Cms.Data" applicationName="/websitetwo" />  
                </providers>  

    The inconvenience with the shared database comes when you want to export one of the websites - you need to use some sql scripts to export this project date and migrate it to another server.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Brook
    Brook avatar
    14 posts
    Registered:
    27 Oct 2009
    24 Apr 2009
    Link to this post
    Thanks Ivan,

    In this case the sub-sites are for the same client, so the export would not need to be split (is for a swim league, sub-sites are for the individual teams).

    Thanks so much!

    Brook
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    24 Apr 2009
    Link to this post
    Hello Brook,

    Let us know if you need further assistance in this matter.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Jerome
    Jerome avatar
    19 posts
    Registered:
    23 Apr 2009
    15 May 2009
    Link to this post
    Hello Ivan,

    How do you get the 'templates' and predefined pages load after you changed the '/' to /Myapp? When I do this I loose all the presets (but not the forums and a few other things).

    I am trying to find a way to the the web.config to get the application name before the project is even started.

    Thanks.

    Jerome
  6. Brook
    Brook avatar
    14 posts
    Registered:
    27 Oct 2009
    16 May 2009
    Link to this post
    I just tried to do the actual set-up to run two community version websites off one sql database and using just the two applicationName=\website attribute entries provided in this thread and it isn't working as I would expect.  Like Jerome, I had the same issue when trying to set-up the second site.  I resolved it by going into the sql database and setting up the second application in the applications table and then going to the roles and users table to add an additional admin user (not fun).  Then I realized that all of the content that I was setting up pages, modules contents were all visible and being shared across sites, so I went into the web.config file located as many of the data.defaultprovider entries I could figure out and added the applicationName attribute to them.  This seems to be starting to isolate each sites contents from the other, but I appear to still be missing some attribute entries as there is still module content being shared across sites.  Is there an easy way to do this (a checklist of all the settings that need to be made to ensure they run seperately from each other)?  I used the Community Edition 3.5 sp1 release.  I am a little disappointed that the suggested method provided to do this is apparently incomplete and I am dreading the time I am going to need to spend to scour the forums, internet and trial and error trying to find all of the settings.  Then after doing so finding out there is going to be some feature that cannot be seperated (eg. Search results or RSS feeds etc...).  If this is not going to be possible then, please let me know otherwise if someone could provide a complete instruction set to accomplish the task it would be greatly appreciated.

    Thanks as always, love the product still!

    Brook
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    18 May 2009
    Link to this post
    Hello Brook,

    In the following section below you need to change applicationName values if you want to separate the content between websites. This section represents all generic content providers that your website has.

    <cmsEngine defaultProvider="Generic_Content"
          <providers> 
            <clear/> 
            <add name="Generic_Content" urlRewriteFormat="[Publication_Date]/[Name].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="True" defaultMetaField="Name" securityProviderName="" allowLocalization="False" allowVersioning="True" allowWorkflow="False" allowComments="false" commentsModeration="true" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Cms.Engine.Data.Providers.DefaultProvider, Telerik.Cms.Engine.Data"/> 
            <add name="News"  allowComments="True" urlRewriteFormat="[Publication_Date]/[Title].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Title" securityProviderName="" allowVersioning="True" applicationName="/News" versioningProviderName="" commentsModeration="true" connectionStringName="GenericContentConnection" type="Telerik.News.Data.DefaultNewsProvider, Telerik.News.Data"/> 
            <add name="Blogs" urlRewriteFormat="[Publication_Date]/[Title].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Title" applicationName="/Blogs" allowVersioning="True" allowComments="true" commentsModeration="false" allowLocalization="False" localizationProviderName="" allowWorkflow="False" securityProviderName="" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Blogs.Data.DefaultBlogProvider, Telerik.Blogs.Data"/> 
            <add name="Libraries" urlRewriteFormat="~/{Provider}/{LibraryName}/[Name].sflb.ashx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" applicationName="/Libraries" allowVersioning="False" allowLocalization="False" localizationProviderName="" allowWorkflow="False" securityProviderName="" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Libraries.Data.DefaultProvider, Telerik.Libraries.Data" tagEditorTemplate="~/Sitefinity/Admin/ControlTemplates/Libraries/BatchTagsEditor.ascx"/> 
            <!--Amazon Data Provider [First turn off the default one] url format can be urlRewriteFormat="~/{Provider}/{LibraryName}/[Name].s3lb" as well in that cae there will extra libraries in the url--> 
            <!--<add name="Libraries" urlRewriteFormat="~/{LibraryName}/[Name].s3lb"  thumbnailExtension=".tmb" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" applicationName="/Libraries" allowVersioning="True" allowLocalization="False" localizationProviderName="" allowWorkflow="False" securityProviderName="" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Libraries.Data.AmazonProvider, Telerik.Libraries.Data" tagEditorTemplate="~/Sitefinity/Admin/ControlTemplates/Libraries/BatchTagsEditor.ascx" />--> 
            <!--Viddler Data Provider Compatible with other libraries, must add a libraryInfo with type = "Viddler"--> 
            <!--<add name="Libraries" urlRewriteFormat="~/{LibraryName}/[Name].sflb.ashx" thumbnailExtension=".tmb" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" applicationName="/Libraries" allowVersioning="True" allowLocalization="False" localizationProviderName="" allowWorkflow="False" securityProviderName="" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Libraries.Data.ViddlerProvider, Telerik.Libraries.Data" tagEditorTemplate="~/Sitefinity/Admin/ControlTemplates/Libraries/BatchTagsEditor.ascx"/>--> 
            <add name="Events" allowComments="True" urlRewriteFormat="[Publication_Date]/[Title].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Title" securityProviderName="" allowVersioning="True" applicationName="/Events" versioningProviderName="" commentsModeration="true" connectionStringName="GenericContentConnection" type="Telerik.Events.Data.DefaultEventsProvider, Telerik.Events.Data"/> 
          </providers> 

    If you want to have different pages between your websites, please modify the application name in the section below:

        <cms defaultProvider="Sitefinity" redirectToHomePage="false" pageExtension=".aspx" disabled="false" pageEditorUIMode="Overlay">  
                <providers>  
                    <clear />  
                    <add connectionStringName="DefaultConnection" allowPageHistory="true" allowPageWorkflow="false" cachingProviderName="ASPNET" name="Sitefinity" type="Telerik.Cms.Data.DefaultProvider, Telerik.Cms.Data" applicationName="/" />  
                </providers>  

    To separate the users you should change the applicationName for <roleManager><providers>, <membership><providers> and <profile><providers> before you have created your admin user. Otherwise you will not be able to log in with any of the existing usees.

    You can also change the Blogs rss provider applicationName from the line below:

    <rssProviders> 
            <clear/> 
            <add name="Blogs" type="Telerik.Blogs.RssProvider, Telerik.Blogs" visible="True" applicationName="/Blogs" rssFieldAuthor="Author" rssFieldTitle="Title" rssFieldPubDate="Publication_Date"/> 
          </rssProviders> 

    The application name should be the same as this one for the Generic content provider.
    Indexing for the pages is based on the items that you have for the existing project. Onece your pages are not shared the indexing and feeds should work nomally.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. Roy
    Roy avatar
    28 posts
    Registered:
    20 Jan 2009
    02 Jun 2009
    Link to this post
    Hello,

    Could you post a sample on how the applicationName should be set for the different providers, e.g.:

     /mysitename/News
     or
     /mysitenameNews

    I think this would make things a bit clearer.

    Thanks in advance.

    Roy


  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    02 Jun 2009
    Link to this post
    Hi Roy,

    The application name should be set as /Mywebsite1 and /Mywebsite2. The names do not matter. But they need to be different if you want to separate the content.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  10. Roy
    Roy avatar
    28 posts
    Registered:
    20 Jan 2009
    11 Jun 2009
    Link to this post
    Hello,

    I followed all steps above and changed the applicationname in the mentioned providers and sections. However I think there are more provider that need an applicationname set or changed. For example the search provider.

    Could you post a sample that lists all the sections that need or can have the applicationname set, to fully seperate 2 sites from each other?

    Thanks,

    Roy

  11. Roy
    Roy avatar
    28 posts
    Registered:
    20 Jan 2009
    11 Jun 2009
    Link to this post
    Hello,

    Just an example: at the moment I'm having 2 sites sharing 1 database. According to the information in this thread and others I have set a different applicationname for both sites. This seems to work fine. However when I create a list in the module section (e.g. FAQ), this list is shown in both sites.

    Is there a way to prevent this and can this be corrected in the already created sites?

    Kind regards,

    Roy

  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    11 Jun 2009
    Link to this post
    Hi Roy,

    For the search provider you need to add  applicationName attribute to it and change it. By default it is "/".

    <search defaultProvider="Search"
          <providers> 
            <clear/> 
            <add name="Search" applicationName="/Website2" type="Telerik.Search.Data.DefaultProvider, Telerik.Search.Data" connectionStringName="DefaultConnection" 
                useCompoundIndexFile="true"/> 
          </providers> 

    You can do the same for the Lists.

    <lists defaultProvider="Sitefinity"
          <providers> 
            <clear/> 
            <add name="Sitefinity" applicationName="/Website2" securityProviderName="" type="Telerik.Lists.Data.DefaultProvider, Telerik.Lists.Data" connectionStringName="DefaultConnection" visible="true"/> 
          </providers> 
        </lists> 

    If you change the applicationName for already existing website with content you will not be able to see the content you have created before the changing.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  13. Jerome
    Jerome avatar
    19 posts
    Registered:
    23 Apr 2009
    22 Jun 2009
    Link to this post
    Thanks, Ivan.

    I followed your instructions and with some db tweaking, I am able to add a number of sites within one db. 

    I am also trying to copy across from on db to an other some Generic content. I copied thre table data as:
    1. sf_GCMetaData
    2. sf_CmsTextContent, and
    3. sf_CmsContentBase

    But these copied generic contants entries are not displaying as expected. I used the proper Application Name.

    Any suggestions are welcome.

    BTW, I am starting to get through tis very powerful application, and I am quite impressed by the depth of what can be accomplished.

    Jerome
  14. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    22 Jun 2009
    Link to this post
    Hi Jerome,

    Possible options:

    1. Try using some db compare tool.
    2. Use Sitefinity API - Manager.GetContent(). You can create two instance for getting the content items. Then checking the items from the first provider list and comparing them from the list of content items in the second provider. If there are any differences you can copy the items. For instance you can use GetMetaData("Title") as a unique identifier.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  15. Matthew
    Matthew avatar
    38 posts
    Registered:
    24 Jun 2012
    30 Jul 2009
    Link to this post
    Hi there,

    Have a client who requires the same setup - One sitefinity codebase/db but multiple subsites rendering different content/website style etc. Is there any step by step doco available on this or is it just a matter of trawling through the forums?

    thanks,
    Matt
  16. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    30 Jul 2009
    Link to this post
    Hi Matthew,

    You can take a look at our User Manual, section Adding Providers.You should have several installations that use data from one database. The post here explains how to set up each provider in project's web.config.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  17. Roy
    Roy avatar
    28 posts
    Registered:
    20 Jan 2009
    30 Jul 2009
    Link to this post
    Hi Matt,

    Please also take a look at the following post "shared database and item with same key error "

    http://www.sitefinity.com/support/forums/sitefinity-3-x/bugs-issues/shared-database-and-item-with-same-key-error.aspx

    You'll find more info about the applicationsNames for each provider.

    Kind regards,

    Roy
  18. Matthew
    Matthew avatar
    38 posts
    Registered:
    24 Jun 2012
    30 Jul 2009
    Link to this post
    This sounds like one database but multiple Sitefinity installations.

    Can I have one database/one Sitefinity installation? the idea here is to have one code base.

    so depending on the host header value (e.g. www.website1.com) the user will see only content/web design based on that particular site. www.website2.com will go to the same IIS entry, Sitefinity application/database but it will render different content/web design

    Possible? tutorial?
  19. tdekoekkoek
    tdekoekkoek avatar
    13 posts
    Registered:
    09 Nov 2006
    30 Jul 2009
    Link to this post
    Matthew,

    I believe this is the same issue that I'm trying to resolve relating to subdomains.  I have not tried it yet, but there is a thread here: http://www.sitefinity.com/support/forums/sitefinity-3-x/developing-with-sitefinity/sub-domains.aspx which discusses a solution.  I'll let you know if I get it working.

    Cheers,

    Trevor
  20. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    31 Jul 2009
    Link to this post
    Hello tdekoekkoek,

    The solution with the subdomains works when subdomians and pages are created and mapped correctly. Generally this approach is related to mapping Group pages to subdomains, but this cannot work in separate domains( website1.com, website2.com)

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  21. Jerome
    Jerome avatar
    19 posts
    Registered:
    23 Apr 2009
    18 Aug 2009
    Link to this post
    Hello,

    I have developed a step by step manual to have multiple Community sites on one database.The document is zipped, but I am not sure how to upload it.

    Jerome
  22. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    18 Aug 2009
    Link to this post
    Hi Jerome,

    You can upload it to some public folder and then send a link from where we can download it. We will take a look at the documentation you have. If it is good we will share it with the community and update your Telerik points.

    I look forward to hearing from you.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  23. Jerome
    Jerome avatar
    19 posts
    Registered:
    23 Apr 2009
  24. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    21 Aug 2009
    Link to this post
    Hello Jerome,

    Unfortunately the location you have posted is unreachable because it leads to the protected (Administration) area of Sitefinity. Is there an option for you to post a live, public url?

    Greatly appreciated!

    Regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  25. Jerome
    Jerome avatar
    19 posts
    Registered:
    23 Apr 2009
    21 Aug 2009
    Link to this post
    http://www.mexservices.net/MultiSitesDemo/TEST.aspx

    That should be working Georgi.
    Yhank you

    Jerome
  26. Jerome
    Jerome avatar
    19 posts
    Registered:
    23 Apr 2009
    21 Aug 2009
    Link to this post
    Georgi,
    It looks like there is an error when you first reach the site. Refreshing the page makes it disappear. I am not sure why.
    The other site on the same data base does NOT do it. Except for that hiccup, which I know can be fixed.. having 2 or more 'separate' sites' works fine. 

    May be you can suggest some fix for this error?

    Great product, but greater team!

    Jerome
  27. Jerome
    Jerome avatar
    19 posts
    Registered:
    23 Apr 2009
    22 Aug 2009
    Link to this post
    The testing of multiple databases uncovered some problems with the Newsletters. I upgraded both sites to 3.7. Then I checked all the modules and when I clicked the newsletters entry.
    I am not sure where to separate newsletters from one site to an other, as the smtp seems to be related to '/'  as an application name.


    Thanks.

    Jerome

    Jerome

  28. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    26 Aug 2009
    Link to this post
    Hello Jerome,

    The issue with the Newsletters module is different. When Sitefinity fail to initialize a service, it skips this part of the code on the second load. That is why you do not see the error again. I am not sure that the error is related to the providers in this case though.

    Is there some entries in the Sitefinity.log file? I cannot load the test.aspx page either. 

    Kind regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  29. Jerome
    Jerome avatar
    19 posts
    Registered:
    23 Apr 2009
    26 Aug 2009
    Link to this post
    Thanks, Georgi

    My quest to get multiple sites in one database is full of challenges. I was able to bring 3 Sitefiny 3.6 Community Editions sites, upgraded later to 3.7 on one SQL DB.

    Then, I tried to move a 'native' 3.7 version... and broke all the other 3. I am debugging this right now.

    Part of my problem is the lack of understanding the relationship between the web.config and the actual calls made by the application to get the pages. For example, at a point in time, I cleared my cookies and every start working again. I am also not clear if i can get Forums/Newsletters/WIKI to have the application name, like we can for Lists/Events/Blogs etc... I searched the documentation for clues on the web.config. Not much success.

    Still learning. I really appreciate the time you spend to help me. Thanks.

    Jerome

  30. Jerome
    Jerome avatar
    19 posts
    Registered:
    23 Apr 2009
    26 Aug 2009
    Link to this post
    BTW, Georgi

    I will try to get various files up and running for your perusal later this week... when I fix the sites.

    Jerome
Register for webinar
42 posts, 0 answered
1 2