How to deploy an ASP.NET website using Umbraco as an example

preview_player
Показать описание
This video gives you step by step instructions for how to deploy an ASP.NET website. I'm using an Umbraco site as an example, but it applies to any ASP.NET website.

Create configurations and transforms

Create different configurations
Create config transforms for UAT and LIVE
Delete Debug and Release
Make sure all of the required files are included in the build
Publish the web project

Right click on the web project, and choose Publish
Select a publish target, choose Custom
Enter a profile name. You want one for each configuration. I'll start with UAT
In publish method, choose File System
In the target location, choose a relevant folder, if it doesn't exist it will create it for you.
Click next
Choose the configuration, so I will choose UAT
File publish options, tick Delete all existing files prior to publish
Click next
Look at the path where it will be published to, make sure it is correct.
Click on Publish
Look at the output, make sure it builds correctly and outputs the files to the destination location.
Now go to the folder where the files are, add them all to a zip file, with a name such as ProjectName YYYY-MM-DD.zip
Saving the file in this format means even if they are sorted alphabetically they will be in the correct date order.
Put the files onto the server

Log onto your server using Remote Desktop (RDP)
If you don't have a server, you could practice doing this on your computer.
On the server, navigate to the web root folder, normally called wwwroot, could be in C:\inetpub
Create a folder for the web project
Paste the zip file inside this folder
Right click, extract all
Delete the zip file
Sort out folder permissions

Make sure the following users have permission to modify this folder: IUSR, IIS_IUSRS
Backup the local database

Open SQL Server Management Studio
Connect
Open out the databases tree view on the left
Right click on the database for your project
Choose tasks and backup
In the destination section, choose disk
Remove any that are already in the list below and click on add
Choose a destination folder and put the name of the file in, something like ProjectName-DB-YYYY-MM-DD.bak, click on OK
Click on OK in the main window.
Create a database on the server

Go to the destination folder where the backup is saved.
Right click on it and add it to a zip file
On the server, paste the db zip file somewhere.
Right click, extract all
Open SQL Server Management studio
Connect to the server
If you don't have a database already, right click on databases and choose New Database.
Name it after your project, I like to add .UAT or .LIVE after the name.
In options make sure the SQL version is the same as the database on your local machine.
Restore the database using the backup

Right click, tasks, restore
In device, choose the backup file ending .bak
In the dropdown, choose the database from the backup.
In the destination dropdown choose the new or existing database on the server for the project
Go to the files page, choose the relevant mdf and log files
In options, make sure overwrite the existing database is ticked.
Click on OK
Sort out database permissions

Under security, go to users and create a new login.
Username, password etc SQL only
In User mappings tick this database, reader, writer owner.
Setup a site in IIS

Create a site in IIS
Point the site the dated folder you created
Start the site

Eliminate any errors
Make sure the connection string is correct

► Buy me a coffee ◄
Рекомендации по теме
Комментарии
Автор

Hi Paul,

This is a great series of videos, they are really helping me get back into Umbraco. The last time I did any real work with it was 8 years ago and I'm pretty sure it was at version 3.

There is one thing I do differently though that some people may find helpful. For any sensitive information like connection strings or email server usernames and passwords I create a .config file and read it from my web.config. This is then excluded from source control, especially useful if you use a public Git repository.

Keep up the good work.

thomasheaney
Автор

Thanks for posting this. Great tutorial. My site is now up for UAT. A few of the steps were different for my server but all good.

JontySG
Автор

Hey Paul
Very usefull and great tutorial !

thomasdk
Автор

So, this is just the UI portion of the Umbraco website. How do you manage the content for this site if the Umbraco Backoffice doesn't exist on this server or is it accessible?

OnTheSpurOfTheMoment
Автор

Hi Paul,
Brilliant videos, good to see relevant content regarding Umbraco, I have just recently started learning how to develop with Umbraco and I love it!!, have you got any plans to make a video showing how to deploy Umbraco on Azure or a live environment by any chance?

alexisperezsosa
Автор

Hi Paul,
can we deploy content website and admin panel website separately in different domains??,
the thing is our website doesn't have direct access to Db server, the Db is accessed only by endpoint API's,
So can we link it together ?, or should we maintain separate Db for Umbraco

dildileepkumar
Автор

Hi Paul, can you do another tutorial on Umbraco Cloud?

icecapgames
Автор

Hey Paul, first of all thanks for the videos. I've been following the "bootstrap static site to umbraco cms" serie and I've learnt a lot. Next step for me is to follow SE02 serie, but in some videos I heard from you advices for new content. Here is mine: an ecommerce with products, categories and subcategories. Sounds good? Thanks a lot and keep pushing

albertalegria
Автор

Hey Paul, could you post a tutorial on how to set up CD/CI for an Umbraco site?

PelFox
Автор

Hi Paul! Great video! But i did notice something, when you published the site, the map "controllers" and "models" dident end up in the final version why is that?

Nukebosss
Автор

Hi Paul,

Thanks again for another relevant tutorial! I have a VPS and I'm using your example... However I have a few questions:

I'm using the Fanoe website to try some things and I chose to use the local/built-in database (DataDirectory - Umbraco.sdf - SqlServerCe.4.0). (I note that it is not included i the project) So, question 1) Is using the local/directory sqlserverCe still a valid way of running the website on my VPS?

2) The "Umbraco" and "Umbraco_Client" directories I noticed were not included in the project but I see that they show up in the finished UAT directory?? Should I include them?

Thank you for doing these tutorials!

Best wishes,
Daniel

danielgillett
Автор

Hi Paul,
Is it possible to create new folders for models and controllers when you want to make changes to an existing Umbraco website? since on deployment these folders are no longer available. Or we need all raw files to make any changes?

adngwarati
Автор

When I do this, my App_Data/models is empty only the foo flag is still there. Also I dont get my content on the website. I get the starter website thing. Do you know what causes this?

AbuSakeenah
Автор

Nice video. Hey Paul I was actually planning on publishing my umbraco test demo site to Azure. should I deploy it the same way as an MVC project?

ericaput
Автор

Hi Paul!

Me again! lol

I have run into - not a problem - but an "unexplainable - web.config transform issue. When I'm updating my UAT web.config file and when I go to check the preview, it doesn't include some of what I've added. I don't get an error, it just doesn't include it. I'll try and explain my setup a little...

I'm running a VPS and using IIS to run my static websites. For one of my websites, I have multiple domain variations - and I also want my domain to always resolve with the www. prefix - to ensure that any of the domain name variations always resolve to my "main" www.mydomain.com. So I installed and happily used the "URL Rewrite" module that you can get for IIS. And All I had to do was drop a web.config file containing the rules into the root directory and the server would pick up the settings and change accordingly. But for some reason, they don't seem to be getting picked up by the transition config file.

Here is a copy & paste example of my UAT that I'm trying to add into the transition. The first part is from your tutorial - the X-Robots-Tag. The second is what I've added under it. (I've changed my domain name and removed a lot of the other domain names to keep it simple):

<system.webServer>
<httpProtocol>
<customHeaders>
<add name="X-Robots-Tag" value="noindex"
</customHeaders>
</httpProtocol>

<httpRedirect enabled="false" />
<rewrite>
<rules>
<rule name="Resolve to www.MyDomainName.co.uk" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" />
<add input="{HTTP_HOST}" />
<add input="{HTTP_HOST}" matchType="Pattern" ignoreCase="true" negate="false" />
</conditions>
</rule>
</rules>
</rewrite>
</system.webServer>

...I should also say that I can manually add this bit into the web.config file of the Umbraco site that I just uploaded and it works fine. ...It's just the transition from VS that I can't understand why it wouldn't add it to the UAT or LIVE transition files. and I'm not sure, but I don't think it's interferring with Umbraco's built in URL Redirect.

Thank you again for looking at this and I hope you can help!

Many thanks!
Daniel

danielgillett
Автор

Do you have a video or advice on how to deploy on-prem Umbraco CMS 8 (MS SQL CE) to a dev web server? Surely documentation exists regarding deployment, right? Could you please pass along a link to such information?

Iamkevinjohnson
Автор

Hi Paul, I'm trying to deploy an umbraco 7.10.4 but i'm getting this error "Error : Copying file bin\Antlr3.Runtime.pdb to failed. Could not find file 'bin\Antlr3.Runtime.pdb'.". What could be the issue? Thanks in advance.

advancengwarati
Автор

Hey Paul, I tried your approach.
I'm getting an error "No physical template file was found for template Home". I checked and made sure that file permissions are all there, but something is still missing. Thanks alot!

Vivalavidapool
Автор

Hi Paul,

I am not using any connection in my code. I am just fetching records from API. In my local it works fine but when i deploy it on Server i am getting error of COnnection string. Can you help me in Solving this error?

souravpal
Автор

umbraco's publish thing doesn't generate index file how to get that

iamsantoshnayak