KB's

Deploying Sitefinity on Plesk powered Shared Hosting

Objective:

Describe how to deploy a Sitefinity website from a local machine to a shared hosting environment using Plesk control panel.

Preparing the website for deployment:

It is important that there is at least one sample content item in each Sitefinity module (Generic Content, News, Blogs… etc.) prior to deploying a Sitefinity website in a shared hosting environment, which usually runs in Medium Trust. Note that the Sitefinity module providers cannot get their database objects created in medium trust environment and you may get errors. To prevent this, you need to enforce database upgrade in full trust environment, i.e. in your local website. Creating at least one content item in each module before uploading the upgraded database to the hosting server will initialize all modules in the database.

We also recommend creating a home page with some filler text, just so you can ensure that your site is working properly when you visit it. Ideally, you should create a theme and a master page on your local machine. Then, create the content (pictures, text, etc.) on the page live. For more information on this subject, you can refer to the Sitefinity User Manual.

Deploying the website:

Uploading all files:

The best and fastest way to upload the website files onto the hosting environment is to use an FTP client such as FileZilla, which is a free ftp solution. Follow the steps below to upload the website files:

1. Login to Plesk control panel and create an FTP user whose credentials will be used in FileZilla or other ftp client to login to the hosting environment.

Plesk control panel screenshot

Adding ftp user screenshot

Adding ftp user screenshot

2. Open FileZilla or your ftp client and login to the hosting server with the ftp user’s credentials that were set up in the previous step

FileZilla screenshot

Note: Ask your hosting company to provide you with the IP address of the server that will be hosting the Sitefinity website

3. Locate the Sitefinity website on the local machine through the file explorer of the ftp client and copy all files to the httpdocs folder of the server.  Replace all existing files on the server, if prompted.

FileZila screenshot

Deploying the database:

Now that we have copied all files to the hosting server we need to also deploy our Sitefinity MS SQL database from our local machine to the hosting environment. Follow the steps below in order to do that:

1. Login to the home page of the Plesk control panel and click on Databases


Plesk control panel screenshot

2. Add a New Database


Plesk control panel screenshot

3. After the database is created, click on its name in order to create a database user


Plesk control panel screenshot

4. Add a new database user


Plesk control panel screenshot

 

Note that Plesk control panel has a web interface for administering the database that we just created, however the interface has very limited functionality and most hosting providers recommend using the SQL Server Management Studio Express instead. Therefore, we need to contact our hosting company and request access to their MS SQL Server. They will provide us with an IP address that we will use as the server name for connecting through the SQL Management Studio. After we have been granted access to the SQL Server of the hosting company we need to follow the steps below in order to import all data from our local database to the database on the server.

1. Open SQL Server Management Studio Express and login to the local instance of the server


SQL Server screenshot

2. Now that we are connected to your local SQL Server, we need to also connect to the remote SQL Server at our hosting company.


SQL Server screenshot

SQL Server screenshot

3. After we are connected to both servers, our Object Explorer should look similar to the below image. Now we need to locate our database on the remote SQL Server and right click on it in order to import the data from our local Sitefinity database.


SQL Server Explorer screenshot

SQL Server screenshot

4. After we have clicked on Import Data… we should follow the on screen instructions of the wizard as show on the screenshots below.


SQL Server screenshot

SQL Server screenshot

SQL Server screenshot

SQL Server screenshot

SQL Server screenshot

After we are finished with the data import, our site is almost ready to go live on our hosting environment. All that is left to do is to adjust the database connection string in our web.config file.

Changing the connection string in the web.config file:

We can use the Plesk Control Panel to update the connection string in our web.config file, which is on the live server. We need to go to the Home page of Plesk and then File Manager -> httpdocs  and click on the web.config file, which will open it in edit mode in our browser. Then, we need to located the following section of the web.config file:

<connectionStrings>
...
</connectionStrings>

We need to update the connection string to the following:

<add name="Sitefinity" connectionString="Data Source=Server_IP_Address,1433; Network Library=DBMSSOCN; Initial Catalog=DatabaseName; User ID=User_Name; Password='User_Password';" />

Replace the bolded words in the above connection string with the corresponding Server IP address, database name, and user credentials.

After we have updated the web.config file we need to click “OK” and visit the website. Our website should be live.

Note: We could also update the connection string on our local machine and FTP the web.config file to the server overwriting the old web.config file.

Editing your website:

If we go to our web site at http://www.mysite.com/, we can see it the way our end users would see it. If we go to http://www.mysite.com/sitefinity, we will be redirected to the Sitefinity login page. After we login to the back end of Sitefinity we can start managing our website pages, content, and digital assets on the live server.