What is the best approach to deploy umbraco to live production?
Hi,
I'm new to umbraco and never had a chance to deploy a website into live which is umbraco and using .net as a scripting language and my point is what is the best way to deploy my umbraco local website into live? I'm using VS2012 as for development purposes, I have experience deploying a website using filezilla because my web host provides FTP, this is my first time to deploy a website into live using umbraco and what is the best practices for this approach?
There are several things to keep in mind when deploying to a live production environment. Each requiring a different approach.
For example, if it's likely that you are regularly going to make updates locally to content and code, you should think about how you are going to sync data (local/production). There are solutions available for that.
But for a simple start ... the initial setup is done more or less the same as for other ASP.NET web applications:
Make sure the requirements of your solution and database match with what your hosting environment and database is capable of (platform, security/accessibility requirements, database requirements, etc.).
For a simple first deployment you can use Visual Studio to Publish your project. If you first publish to your local filesystem, Filezilla can be used to ftp the published files to your webserver.
In case you are using a local database like SQL Server, copy the structure and content of your local Umbraco database to the database on the server.
You normally don't need (or want) to deploy the files from App_Data folder. At least not the files in the TEMP folder. In the "Publish" dialog in Visual Studio there is an option to "exclude files from the App _ Data folder"...
Looks something like this: http://i.stack.imgur.com/vYxQW.jpg
Just try to exclude the App _ Data folder. The intended use of App _ Data is to store application specific data, like logs, cache, search index etc. That's why you don't want to push this data from your dev environment to production. Umbraco should generate all the files needed for the App _ Data folder once you launch the site in production. (This is not specific to Umbraco, but all ASP.NET projects)
There's only one file in the App_Data that needs to be deployed if you want to copy the local document structure to the server:
umbraco.config
Subfolders of App_Data:
Logs
packages
TEMP
can be removed from your deployment.
Further, check if all relevant .config files are in your deployment.
In general, content, (partial) views, javascript libraries, media, etc. you added locally (in Umbaco editor or custom code/extensions/libraries in your Visual Studio project) , need to be deployed, so if these files are not yet included, add them.
But even the umbraco.config will be generated automatically by Umbraco if not present, so I never include anything from App _ Data in my deploys. (Sometimes I delete the file on new deploys, because I want to be sure it is regenerated from the latest data)
I'm having a minor problem here I use sql server management studio 2014
for my local database now I want to export it and upload my local database to my server what is the best way to do this? my purpose is I wan't to learn the best practices.
If you have administrator rights to restore backups on the server, Tommy's suggestion (backup, restore) is the easiest to do.
As an alternative ...
If you are not allowed to restore a database on the server, you can generate the SQL scripts from within SQL Server Management Studio (right click your database: Tasks | Generate Scripts - use the advanced settings to generate schema + data scripts).
After carefully checking the script, run the script on the server.
The error message on the stackexchange post is not the same as you got. Try searching for the exact error message and you will find the answer. If not, let me know
I'm having a problem I have restore the database to my free hosting site just for testing and I did update my connectionString into something like this.
**connectionString="-------------;
Initial Catalog=-------------;
User Id=-------------;
Password=-------------"**
and this is generated from my server which is a free hosting site again just for testing.
but when I access my site a horrible text show up my site is down
I did some testing I installed a fresh umbraco in latest version using nuget and move all the files and local database into the server I get the start up umbraco page its good and running fine and I can access umbraco backoffice but when I add a document type with properties and then try to publish... the site is down again.
What is the best approach to deploy umbraco to live production?
Hi,
I'm new to umbraco and never had a chance to deploy a website into live which is umbraco and using .net as a scripting language and my point is what is the best way to deploy my umbraco local website into live? I'm using VS2012 as for development purposes, I have experience deploying a website using filezilla because my web host provides FTP, this is my first time to deploy a website into live using umbraco and what is the best practices for this approach?
Any suggestion would be appreciated.
If your production server supports WebDeploy, I would recommend that. I use web deployment packages as described here
There are several things to keep in mind when deploying to a live production environment. Each requiring a different approach. For example, if it's likely that you are regularly going to make updates locally to content and code, you should think about how you are going to sync data (local/production). There are solutions available for that.
But for a simple start ... the initial setup is done more or less the same as for other ASP.NET web applications:
Make sure the requirements of your solution and database match with what your hosting environment and database is capable of (platform, security/accessibility requirements, database requirements, etc.).
For a simple first deployment you can use Visual Studio to Publish your project. If you first publish to your local filesystem, Filezilla can be used to ftp the published files to your webserver.
In case you are using a local database like SQL Server, copy the structure and content of your local Umbraco database to the database on the server.
Hi Micha,
I try to publish my project using filesystem method but it throws error
What did I missed?
Hi Glen,
You normally don't need (or want) to deploy the files from App_Data folder. At least not the files in the TEMP folder. In the "Publish" dialog in Visual Studio there is an option to "exclude files from the App _ Data folder"... Looks something like this: http://i.stack.imgur.com/vYxQW.jpg
Hi Tommy,
I got no Idea what files should be included when publishing umbraco because I have never deployed even one in live production.
Maybe you have some links that I can poke around and read some details.
Thank you for your time,
Glen
Just try to exclude the App _ Data folder. The intended use of App _ Data is to store application specific data, like logs, cache, search index etc. That's why you don't want to push this data from your dev environment to production. Umbraco should generate all the files needed for the App _ Data folder once you launch the site in production. (This is not specific to Umbraco, but all ASP.NET projects)
There's only one file in the App_Data that needs to be deployed if you want to copy the local document structure to the server:
Subfolders of App_Data:
Logs
packages
TEMP
can be removed from your deployment.
Further, check if all relevant .config files are in your deployment.
In general, content, (partial) views, javascript libraries, media, etc. you added locally (in Umbaco editor or custom code/extensions/libraries in your Visual Studio project) , need to be deployed, so if these files are not yet included, add them.
Hope this helps you further ...
Hi Tommy,
Thank you very much for your time and pointing out some details that I haven't knew it help me a lot.
have a nice day!!
Glen
Hi Micha,
Thanks for your suggestion if anything pop up I will let you know, really appreciated for guiding me throughout the process.
have nice day!!
Glen
But even the umbraco.config will be generated automatically by Umbraco if not present, so I never include anything from App _ Data in my deploys. (Sometimes I delete the file on new deploys, because I want to be sure it is regenerated from the latest data)
I wrote down a checklist for Umbraco deployments a while ago. You might find some useful information https://github.com/engern/Umbraco-Deployment-Checklist
Hi Tommy,
Thanks for the link if anything come up I will let you know.
Glen
Hi Micha,
Awesome suggestion you got there a big thanks for you.
Glen
Hi,
I'm having a minor problem here I use sql server management studio 2014 for my local database now I want to export it and upload my local database to my server what is the best way to do this? my purpose is I wan't to learn the best practices.
Any suggestion would be appreciated.
Glen
Assuming that you have SQL Server Management Studio and administrator right on both local and production database servers:
Like this: https://www.youtube.com/watch?v=GRSRmGlglnI
If you have administrator rights to restore backups on the server, Tommy's suggestion (backup, restore) is the easiest to do.
As an alternative ...
If you are not allowed to restore a database on the server, you can generate the SQL scripts from within SQL Server Management Studio (right click your database: Tasks | Generate Scripts - use the advanced settings to generate schema + data scripts).
After carefully checking the script, run the script on the server.
Hi Tommy,
I get this error and I google it but this topic http://dba.stackexchange.com/questions/21757/sql-server-management-studio-backup-error is not helping me to solve the problem.
Any Idea why is this happening?
Glen
The error message on the stackexchange post is not the same as you got. Try searching for the exact error message and you will find the answer. If not, let me know
hint:
Hi Tommy,
I'm having a problem I have restore the database to my free hosting site just for testing and I did update my connectionString into something like this.
**connectionString="-------------;
Initial Catalog=-------------;
User Id=-------------;
Password=-------------"**
and this is generated from my server which is a free hosting site again just for testing.
but when I access my site a horrible text show up my site is down
This site can’t be reached
Glen
You added the binding to your site in IIS, so it's able to resolve the host name?
https://technet.microsoft.com/en-us/library/cc731692(v=ws.10).aspx
Hi Tommy,
I can access my site and it show error after I update customErrors mode="Off" The problem is connecting to my server database.
In my web.config I did update connectionString into this.
and then I access my site it show.
What did I missed any Idea?
Seems like the database server is not allowing communication from the web server on port 1433...
Hi Tommy,
I did some testing I installed a fresh umbraco in latest version using nuget and move all the files and local database into the server I get the start up umbraco page its good and running fine and I can access umbraco backoffice but when I add a document type with properties and then try to publish... the site is down again.
What did I missed?
folder structure
is working on a reply...