It's not always easy for Content Authors to check their work using the Experience Editor or Sitecore's Preview feature, especially when using workflow. Sometimes, there's just no substitute for seeing the content on the site, itself. In this post, I will show you how you can easily set up a Preview environment for your Content Authors in a way that doesn't require any additional licensing and given the client the ability to even preview items not in the final workflow state.
A preview environment is exactly what it sounds like: a Sitecore site meant for previewing content. A Preview Environment is basically just a CD environment. Preview Environments differ from production environments in the following ways:
Like all CD environments, Preview Environments each have their own web database that is separate from the Production web database. Content Authors will see the Preview Environment in their list of publishing targets and can choose when to or not to publish there. Of course, this also means that there is no guarantee that the Preview Database will have all of the same content as the Production Web Database.
The following steps are the minimum of what you will need in order to set up a Preview Environment.
Remember that the Preview Database is just another web database. Start by attaching another copy of the Web database for your Sitecore version to SQL and name it as desired. Next, add the following connection string to your App_Config/ConnectionStrings.config file, and update it with the necessary values.
<add name="preview" connectionString="user id=user;password=password;Data Source=(local);Database=Sitecore_Preview" />
Create a new patch file in your App_Config/Include folder named something like PreviewEnvironment.config and copy the below into it:
<database id="preview" singleInstance="true" type="Sitecore.Data.Database, Sitecore.Kernel">
<dataProvider ref="dataProviders/main" param1="$(id)">
<sc.include file="/App_Config/Prefetch/Common.config" />
<sc.include file="/App_Config/Prefetch/Webdb.config" />
<proxyDataProvider ref="proxyDataProviders/main" param1="$(id)" />
<archive name="archive" />
<archive name="recyclebin" />
<obj type="Sitecore.Data.$(database).$(database)HistoryStorage, Sitecore.Kernel">
<NotificationProvider type="Sitecore.Data.DataProviders.$(database).$(database)NotificationProvider, Sitecore.Kernel">
Open up Sitecore and navigate to /sitecore/system/Publishing targets. Right-click the item and insert a child item from the Publishing Target template. Name it whatever you want, bearing in mind that this is the name that the Content Authors will know your Preview Environment by.
In the "Target database" field, supply the database id that you specified in your configuration file (should be the same as the name of your connection string). Optional: depending on how your client wants their Preview Environment to work, you can check the "Preview publishing target" checkbox. If checked, Content Authors will be able to publish items that are not in the final workflow state to their publishing target for previewing.
Install a fresh instance of your site and configure it to use your "preview" connection string for its "web" database. You can install this instance on the same server or a different one, but it is important that you do not assign a public domain to point at the new instance. This is to make sure that you do not violate any Sitecore licensing terms. You can, however, assign a local or network-only domain to point at the new instance, should you so desire.
Even if you're load balancing your site's CD environment, it's likely going to be overkill to load-balance your Preview Environment. Regardless, you have the option of configuring all of the same scalability settings that you configured for your CD.
That's all you have to do! You should now have a fully functional Preview Environment for your Content Authors to use.