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

Forums / Deployment / Multipule sitefinity sites in one DB?

Multipule sitefinity sites in one DB?

6 posts, 0 answered
  1. Jacques Woolston
    Jacques Woolston avatar
    3 posts
    Registered:
    19 Apr 2007
    28 Aug 2007
    Link to this post
    Hi,

    I'm completely new to sitefinity and know nothing about it yet really... I'm just wondering how the DB setup works for a production environment. With my current host I pay each MSSQL DB then by the size and it's quite expensive.

    So my question is - Can multipule sitefinity sites use the same MSSQL DB? Or does each site need it's own DB?

    Thanks
  2. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    28 Aug 2007
    Link to this post
    Hello Jacques Woolston,

    Thank you very much for your interest in our CMS and contacting us.

    You can use a single database for multiple sites. Each data provider has a property applicationName. By this name the data is separated or shared between sites. By default this name is “/”. So if you have two sites connected to the same database and both sites are set so their CMS data providers are with identical application names, both sites will act as one. That is, pages added to one of the sites will appear on the other as well. On the other hand, if you set them with different names, they will act as if they were connected to different databases.

    In other words, if you set all sites to use a single database with the same application name, your editors will have to dig through to find their information. Setting the sites with different application names will solve the problem with the editors but when mirrored to the production server, the sites will continue to act as separate ones. Actually, on the production server only the entries for the default provider will be visible. To overcome this problem, you have two choices:

    1.    Use a single database and different application names. When the new records are copied to the production database, make all application names the same (this could be done using a stored procedure). To achieve this, follow the steps below:
    1.1. Create all projects that are going to be merged at the end.
    1.2. Specify the connection strings so that all projects are connected to the same database.
    1.3. Set an appropriate applicationName for each project (e.g. department site) in the web.config like this:
    <cms defaultProvider="Sitefinity" pageExtension=".aspx">    
    <providers>
    <clear/>
    <add name="Sitefinity"
    applicationName="/Department-1"
    allowPageHistory="true"
    allowPageWorkflow="false"
    type="Telerik.Cms.Data.DefaultProvider, Telerik.Cms.Data"          connectionStringName="DefaultConnection" />

    </providers>
    </cms>

    You need to do the same for <cmsEngine> section (Generic Content providers) if you are going to use shared content or other modules deriving from Generic Content (News, Blogs).

    2.    Use separate databases for each site on the development side. Set all sites to use the same application name or leave the default settings. Merge all databases on the production server.

    Do let us know if you have any other inquiries.

    Kind regards,
    Rebecca
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Jacques Woolston
    Jacques Woolston avatar
    3 posts
    Registered:
    19 Apr 2007
    28 Aug 2007
    Link to this post
    Ok thanks for the info...

    Sorry about this next question, I could probably spend a couple of hours and work it out myself once I install sitefinity - If on the production SQL server you had multipule sites working in one DB would it be possible to Query the server to find out how much DB space each site was using??

    Thanks again.
  4. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    28 Aug 2007
    Link to this post
    Hello Jacques,

    We are not sure that we understand your question. What do you mean by "DB space"?

    So I will try to explain how the database objects from the different sites are stored in the database. For example, lets get the pages table:

    Application     PageID               Name
    ------------------------------------------------------
    Site1                a3f1fa64-3..       Home
    Site2                20aa0d83-9      Home


    The first record represents the Home page in the Site1, the second is the Home page in the Site2. The same goes to all database objects.

    Could you elaborate more about your request, so we could give you an appropriate answer.


    Kind regards,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Jacques Woolston
    Jacques Woolston avatar
    3 posts
    Registered:
    19 Apr 2007
    28 Aug 2007
    Link to this post
    Sorry... I will elaborate. Our hosting company charge MSSQL databases at a per DB level then the size of the DB.

    So if I were to have many domains with sitefinity sites on each and I make them all use the same DB I'd like to be able to monitor how much MSSQL DB space each domain (or site) is using in that DB.

    Off the top of my head I can't think of a way of doing this without a fair bit of research into your product and reading about MS SQL 2000/2005. Do you know if this would be possible?

    Thanks
  6. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    28 Aug 2007
    Link to this post
    Hi Jacques Woolston,

    Unfortunately, I don't think it is possible.

    Regards,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
6 posts, 0 answered