Best practice for deploying a site from Visual Studio to Production Server
I've gone over tons of blog posts and tried various methods, but I still can't quite get the best way to develop on Visual Studio and then deploy to a server.
There's always something small that breaks. Umbraco Courier was an option that I used some years ago, but now I see it costs $1500, which is WAY too much for me. Here's what I've tried - if anyone can give me a better way to do this, I'll be very happy!
No Umbraco Cloud - I've tried this out and it works great. However, I am not doing this for a business, and don't want to pay $30 a month for my small blog.
No Courier - See above.
Hosting is not an issue. I have access to Azure through MSDN, as well as an IIS/SQL Server of my own. I can use WebDeploy or Azure Publishing
My current workflow looks like this
Install UmbracoCMS in a new project in VS 2017.
Set it up locally with SQL CE
Create templates, doctypes etc.
Publish via WebDeploy. I'm including the .sdf file for now.
Use Visual Studio Team services for source control. The .sdf file is always included, so I can rollback to a known good version.
This workflow works ok because I'm essentially embedding the DB, and moving the entire site back and forth between my local repo and the webserver.
If I create content on the server, I can download it into Visual Studio, and also download the .sdf file.
At some point I will migrate to an SQL Server DB, and that's where I'm wondering how to do it. I have two options that I can see
Set my VS Project to use the same database. This keeps everything consistent, but I'll need to be constantly online, and if I make changes that I don't like, I'll have to figure out how to roll back the DB
Set my VS Project to a local DB - this lets me do whatever I want without breaking the live site, but it's a pain to publish. I can upload the files on disk, but how do I upload the DB changes? Also, if I have two DBs, I believe the IDs change and it doesn't necessarily work.
How do you guys manage your workflows? Any best practices that are a) free, and b) easy for a single developer to implement?
Ask me any questions you like. Discussing this would be great.
When we want to do any development we download a backup of the database and work locally using that. All document type modifications are done on development machines and we use uSync with this deploying them and code changes to live using MS deploy. We never deploy our development databases to live and instead make content modifications on live only after release.
This only becomes an issue when you make breaking content changes but without Courier or Umbraco Cloud (as Umbraco Deploy) we've found not better options.
Thanks for responding. Yeah, that's what I've seen as well - it's not really possible to do doctype changes in live and dev and merge them together (without Courier). Sure, there are ways of doing it, but it will break at some point when I inevitably forget and make a change in live that breaks something in Dev or vice-versa.
I wanted to make sure I wasn't missing something simple that would make my life easier. Apparently not - even professional developers who are using this commercially have the same issues that I noticed.
You are correct, it comes down to process for us. If it does happen that somebody edit a DocType on Live we can always take the uSync files from live and apply of Dev!
Best practice for deploying a site from Visual Studio to Production Server
I've gone over tons of blog posts and tried various methods, but I still can't quite get the best way to develop on Visual Studio and then deploy to a server.
There's always something small that breaks. Umbraco Courier was an option that I used some years ago, but now I see it costs $1500, which is WAY too much for me. Here's what I've tried - if anyone can give me a better way to do this, I'll be very happy!
No Umbraco Cloud - I've tried this out and it works great. However, I am not doing this for a business, and don't want to pay $30 a month for my small blog.
No Courier - See above.
Hosting is not an issue. I have access to Azure through MSDN, as well as an IIS/SQL Server of my own. I can use WebDeploy or Azure Publishing
My current workflow looks like this
This workflow works ok because I'm essentially embedding the DB, and moving the entire site back and forth between my local repo and the webserver.
If I create content on the server, I can download it into Visual Studio, and also download the .sdf file.
At some point I will migrate to an SQL Server DB, and that's where I'm wondering how to do it. I have two options that I can see
Set my VS Project to use the same database. This keeps everything consistent, but I'll need to be constantly online, and if I make changes that I don't like, I'll have to figure out how to roll back the DB
Set my VS Project to a local DB - this lets me do whatever I want without breaking the live site, but it's a pain to publish. I can upload the files on disk, but how do I upload the DB changes? Also, if I have two DBs, I believe the IDs change and it doesn't necessarily work.
How do you guys manage your workflows? Any best practices that are a) free, and b) easy for a single developer to implement?
Ask me any questions you like. Discussing this would be great.
Thanks
Just to add - is uSync a good way to do this?
Hi Aditya,
The setup we have is a follows:
When we want to do any development we download a backup of the database and work locally using that. All document type modifications are done on development machines and we use uSync with this deploying them and code changes to live using MS deploy. We never deploy our development databases to live and instead make content modifications on live only after release.
This only becomes an issue when you make breaking content changes but without Courier or Umbraco Cloud (as Umbraco Deploy) we've found not better options.
Thanks Andy
Thanks for responding. Yeah, that's what I've seen as well - it's not really possible to do doctype changes in live and dev and merge them together (without Courier). Sure, there are ways of doing it, but it will break at some point when I inevitably forget and make a change in live that breaks something in Dev or vice-versa.
I wanted to make sure I wasn't missing something simple that would make my life easier. Apparently not - even professional developers who are using this commercially have the same issues that I noticed.
You are correct, it comes down to process for us. If it does happen that somebody edit a DocType on Live we can always take the uSync files from live and apply of Dev!
Andy
is working on a reply...