Share This
 
All Posts  /  Kentico Development Tips  /  November 16, 2016 

How to set up Kentico staging and production sites locally

Kentico has an amazing content staging feature that allows site administrators to easily transfer content and/or objects from one instance / environment to another. During development it might be useful to set up this feature locally so that you can test it when doing custom development. In this blog post, I will walk you through how to set up content staging and production sites on your local environment. There may be other ways to do this, but I find this method to be pretty simple.

I used the following to set up my environment:
Windows 10
Microsoft SQL Server 2014
Microsoft SQL Server Management Studio
IIS Manager (10)
Kentico 9

If you haven't already installed Kentico on your computer, go ahead and follow the instructions here first to configure IIS, then here to run a custom install of Kentico. 

Check to make sure that your staging site is running. I usually just set mine up as localhost.

Copy all of your site files into another folder. For example, I installed my Kentico staging site into C:\inetpub\wwwroot\Kentico9Stage, then I copied all of the files in that folder into another folder (C:\inetpub\wwwroot\Kentico9Prod)

Make a backup of the kentico database that is running your site by going into SQL Server Management Studio, right click on the database > Tasks >  Back Up

Create a new database or click on an existing database that you don't mind replacing & go to Tasks > Restore > Database
Restore Database

Click Device & navigate to the location where your backup is. Make sure you change the Destination database name to the new production db name. If necessary, click on Options and select Overwrite the existing database, and close existing connection to destination database. Then click OK to restore the database. 

Open the production site web.config file and update the CMSConnectionString to change the name of the database to the production database that you just restored.

In IIS Manager, right click on Sites and select Add Website. 

Enter your production site name, the path to the production site (C:\inetpub\wwwroot\Kentico9Prod) , and the host name, click OK. Ideally the host name would be that of some development site you already have a license for. If you don't have any dev site licenses, then you can generate or request dev licenses at client.kentico.com.

Next you will need to update your host file. Once you have opened your host file, add the following line to it and save. 

127.0.0.1 dev.myprodsite.com

This allows you to override the DNS to that domain so that when you go to that URL it will look for the site locally.
Host File

Then go to that URL in your browser and check to ensure the site is running. If it is then you will need to go to the Kentico Licenses application on that site and add the license for that domain, and you will need to update the site url in the Kentico Sites application.

Once you have both sites running, you can set them up just like you would any other staging and production sites by reviewing the Kentico documentation Configuring Content Staging



 
Show More
Share This
 
Comments
Blog post currently doesn't have any comments.
*
 Security code
*
ADD COMMENT
Social Buzz

Get in Touch

Contact

Contact
t: 973.539.5255
f: 973.917.4730

Visit

Visit
715 Main Street
Boonton, NJ 07005

Locations

Locations
Boonton
Dallas
Jersey City
Boulder

Send Us a Message




 Security code