Reputation:
We are setting up our first migration to Sitecore. We have multiple multi-lingual sites with content stored in database fields with LCID. User controls make database calls to show different language content. We are migrating our content to Sitecore items and would like to leverage the Sitecore API to get the content from our User Controls to build data structures.
I would like to know how to structure Visual Studio projects for Sitecore development in order to use the existing VS solutions. Do we duplicate Sitecore .dlls and configs to all solutions, or share one Sitecore installation?
Also, how do you install the required files in production to support multiple sites which exist as separate websites in IIS? Do we have to have duplicate copies of all the required .dlls and config files in a seperate /sitecore
folder for each website, or we share one folder with a virtual folder in each site pointing to the same physical /sitecore
folder?
Upvotes: 7
Views: 4055
Reputation: 104
For my understanding, I can see that you have two concerns here:
1. How to structure the Sitecore project
I am a sitecore developer for more than 3 years, based on my experience, the best pratice is to create a single Sitecore project that is the highest layer of your solution You dont need to install sitecore dlls to all project, just keep your old code as it was and turn it to the base code. For example, i just finished a project that the customer wants to move to using Sitecore, the solution was already there, it has 4 projects:
We created a new project that should be install Sitecore dlls, that actually replace the ABC.Web(highest layer)that will contains all the Sitecore MVC code and didn't change any thing to old code. From that point, we can work with with both data from the old system (by referencing the ABC.Services dlls) and from Sitecore as well.
2. How do you install the required files in production to support multiple sites?
Sitecore do support multisite by structurizing the Sitecore content tree and a litte config. You DON"T need to create separeate websites in IIS, they are actually ONE website with different domains.In the config file named SiteDefinition.config (or you can add your own config file), you basically set a domain with a start item. Sitecore recognizes the domain that match with the one in config file and will redirect to the start item correspondingly. Eg. In the image, i created 2 sites (essentially, they are 2 branches of sitecore content tree) with start items are (MySite1 and MySite2)
this is my config
<sites>
<site name="MySite1" patch:before="site[@name='website']"
virtualFolder="/"
physicalFolder="/"
rootPath="/sitecore/content"
startItem="/content/MySite1/home"
database="web"
domain="extranet"
allowDebug="true"
cacheHtml="true"
htmlCacheSize="50MB"
enablePreview="true"
enableWebEdit="true"
enableDebugger="true"
disableClientData="false"/>
<site name="MySite2" patch:before="site[@name='website']"
virtualFolder="/"
physicalFolder="/"
rootPath="/sitecore/content"
startItem="/content/MySite2/home"
database="web"
domain="extranet"
allowDebug="true"
cacheHtml="true"
htmlCacheSize="50MB"
enablePreview="true"
enableWebEdit="true"
enableDebugger="true"
disableClientData="false"/>
</sites>
You can reference this tutorial for more details
https://briancaos.wordpress.com/2010/03/01/working-with-multiple-sites-in-sitecore/
Upvotes: 1
Reputation: 370
For question number 2 :
We use Helix guidelines / Habitat, It seems to be the source for Sitecore best practice. All the training of sitecore says to create a project outside of Sitecore and only import things as you need them. For Configuration I would suggest quickly reading this
It's true about SSL and application pools can become an issue. Deploying to one customer's site will bring down all, depending on the setup.
If you go multi-instance you will need to look at your sitecore licensing.
Upvotes: 1
Reputation: 1445
My litmus test is if I can create a site with a Sim tool and deploy my project code and items, does my site work? In some situations, we pull production/stage content from Sitecore using PowerShell, copy the package to a Nuget server and deploy it to development/CI with PowerShell.
To create a site, I have used Sim tools with the command line or this Powershell script.
You are not alone in your frustration. I have run into several clients who have the entier Sitecore web site in their solution. Deployments and upgrades are always very difficult. But if you design a solution that includes no actual Sitecore files and can be deployed to a blank site via CI. Then you will be in great shape.
Upvotes: 2
Reputation: 504
In my experience, the "everything under 1 IIS Website" for multiple sites with Sitecore only works when you don't have the following:
If you have either of these requirements, they must be different websites in IIS (or the requirements must be handled outside IIS).
As for how do you set this up, one thing to keep in mind is that we were told that having multiple installs of Sitecore on a server requires a different/multiple licenses.
So for us, we had to share the same install with multiple sites in IIS because we had both of these requirements (and only one license). We had all the websites share the same Sitecore install (all files shared, including DLLs and web.config). The draw backs to this are:
Upvotes: 6
Reputation: 881
In general we recommend to run everything under 1 IIS website. This saves a lot of configuration and deployment issues. Beside of that, it's not necesarry performance wise to use multiple websites.
Settings up the projects can be done pretty straight forward. Simply make sure the build targets are set towards the /Website/bin-folder of the Sitecore installation. If so, you're able to reuse anything. You can link the Sitecore.Kernel as a Solution Item in Visual Studio.
Overall I think that you should consult your local Sitecore office to think with you setting up this solution. As we're experienced with these kind of migrations, we're happy to give you the right advice and discuss all options.
Upvotes: 4