Categories
CMS Sitefinity Uncategorized

Ultimate Sitefinity Setup Guide: Part One

This Guide

This guide is my ultimate guide to setting up Sitefinity.  I’ll be updating it as I find new things that I commonly do when I want to setup a new project.  Today, I’ll be going over common Visual Studio solution changes, Sitefinity Settings and more that I use on almost every project.

Initial Setup

Creating the Project

I highly recommend using the Sitefinity Project Manager (an exe) to setup the initial project.  It does a great job of getting a clean project.  Instructions on how to use the project manager can be found in Sitefinity’s Documentation.

Running the Blank Slate

Next follow the documentation on running the empty project and getting it running on your local machine.  Once you get to the Sitefinity backend dashboard, your all set to start creating your website.

BUT….

While it is possible to get started on your website at this point, it is my opinion that the setup is not officially done.  There are a lot of quality of life things that can be implemented outside of the CMS that will save you a lot of time.

Project Improvements

  1. Save your Sitefinity solution.
  2. Show all files
    1. Include the following files and folders to the project
      • Project Root\App_Data\Sitefinity\Configuration
      • Project Root\App_Data\Sitefinity\Sitefinity.lic
      • Project Root\App_Data\Sitefinity\Storage
      • Project Root\ResourcePackages
    2. Delete the following files and folders from the project
      1. Project Root\Backup
      2. Project Root\UpgradeLog.htm
  3. Setup solution to use Sitefinity Nuget Packages
    1. Setup Sitefinity Nuget using documentation
      • I also found this blog post by Pantaley Stoyanov to be helpful for setting this up properly, especially if I ran into some issues.
    2. Run the following command in Package Manager Console:
      1. Update-Package Telerik.Sitefinity.All -Version X.X.XXXX.X -Source http://nuget.sitefinity.com/nuget
  4. Add NuGet.config file to project root – This will be used by VSTS for building our solution using Sitefinity’s NuGet server.
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
     <packageSources>
     <add key="SitefinityNuGet" value="http://nuget.sitefinity.com/nuget" />
     <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
     </packageSources>
     <activePackageSource>
     <add key="All" value="(Aggregate source)" />
     </activePackageSource>
    </configuration>

Continuous Integration with VSTS

I use VSTS for it’s default source control and continuous integration.  There are others out there but this one is mine.  I have found that VSTS can do everything I’d like it to when it comes to source control and deploying Sitefinity sites to their home.  Here are the steps I follow to set this up?

Setting Up Your Deployment Group

  1. Open your VSTS Project and click on Deployment Groups.  This will help up the target server that will be hosting the site.
  2. Add a new deployment group and give it a name.
  3. Once that is completed, you are given a powershell registration script to run on the host server.  *I highly recommend using the script, the other options tend to take way longer to setup*Deployment Group Script

Setting Up Build Configuration

  1. Click on the Builds tab and Create a new Build
  2. Select the ASP.NET (Preview) template
  3. On the Process Screen give your process a name
  4. Pick your Agent Queue
    1. I like to use the hosted VS2017 agent but its possible to install your own agents on your On Premises build services.
  5. Choose the solution that you wish to build from Source Control.
  6. The template should come with a Get Sources, NuGet Restor, and Build Solution step.  You’ll need to create a Publish Artifact step as well.
  7. Get Sources
    1. Pick where the code is coming from.  In this case from VSTS
    2. Pick the repository from VSTS to use
    3. Select your branch
  8. NuGet Restore
    1. Set your Display Name
    2. You command should be restore
    3. Feeds to use – Pick Feeds in my NuGet.config
    4. Your path can be empty if the NuGet.config exists in your project root.
    5. In Build solution you should be able to use the default settings.
  9. Publish Artifact
    1. Create your display name
    2. Set Path to Publish as $(Build.ArtifactStagingDirectory)
    3. Set Artifact name to Drop
    4. Set Artifact type to server

Your Done!

Setting up Releases

  1. Create a new release definition
  2. My server is a VM on a cloud machine so the template I am choosing is IIS Website and SQL database Deploy
  3. Click on Add Artifact
  4. Pick you Source – which is the build definition you want to keep
  5. Open the Environment Area
  6. Delete the SQL Deployment for now.  You might want to deploy your database later
  7. Click on Manage IISWebsite
    1. Create your display name
    2. Your configuration type should be IIS Website
    3. Create or Update
    4. Enter the website name that you want it to show in IIS
    5. Select the physical path of where you want the website file deployed.
    6. Its possible to setup the bindings from here but I chose to setup the IIS bindings on the server myself.
  8. Click on Deploy IIS Website/App
    1. Enter the display name
    2. Enter the website name
    3. Make sure your package or folder is $(System.DefaultWorkingDirectory)\**\*.zip
  9. Your Done

Conclusion

A lot of the is the default options but once I tinkered with the above settings I was able to get this up in running in just a couple of hours.  I had zero experience with this before hand.  In part two, I will be describing listing out all of the Sitefinity settings that I feel should be automatically included and the way to set them up without running the solution.

 

 

 

 

 

 

By Brett The Whitt

Brett is a web development consultant and has been working for more than 12 years. He specializes in hybrid mobile app development and using front end frameworks such as AngularJS. Always passionate about continuous education, he has been most recently mentoring and encouraging his co-workers to become better speakers. To further this growth, he leads Lightning Talk Nights and other events at his job at HMB Inc

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s