Umbraco best practice for deploying content [closed]
Asked Answered
D

2

5

So, I have a staging and live environment of Umbraco.

Our content guys make changes in Live because they need something to be visible straight away.

Now, to back this up - I'm currently copying & pasting what they've done onto our staging environment and putting into source control..

Is there a better way of doing this?

Depoliti answered 27/11, 2014 at 15:50 Comment(2)
they are content guys, does that mean you want the content they're editing in SVN? (I would advise against putting content in SVN) or are they editing templates or doctypes? and you want those in SVN?Savory
Are your content editors editing things other than content and media? Are they editing Document Types, Templates, Macros, and/or Data Types?Blowup
B
15

From what I know of your situation, I would recommend setting up the staging site and the production site with the same database. Unless you are using the ContentService to pull content into your templates (which you should avoid because it hits the DB), your umbraco site should only be hitting the App_Data/umbraco.config xml cache and the examine indexes in App_Data/TEMP/ExamineIndexes. This means that even though your staging and production site will be sharing the same database, changes that you make on the staging site won't show up on the production site until you log in and republish the entire site or republish the specific node.

This approach is definitely not appropriate for every scenario. For example, we have clients who won't like that the database is shared for security reasons. They want as much separation from the production site and the staging site as possible. I also wouldn't use this if the content on the site is very time sensitive. If content being accidentally published before it is ready would be very bad for your client, this might not be the best solution. We haven't experienced any trouble with the xml cache being automatically refreshed when we weren't ready, but I wouldn't trust a cache to protect sensitive information from being released early.

We have been using it and are very happy with the simplicity. There are very few moving parts, so compared to some of the other deployment methods below, this is a pretty safe way to deploy. To make things more user friendly for our clients, we rig up a button on our staging site that, when clicked, will republish the cache for that node on the production site. I hope to release this as a package and will update this answer with a link to the package when it is ready.

UPDATE I would consider the above approach experimental. Umbraco has been putting a lot of work into load balancing scenarios in later versions of umbraco 7, and some of the work they have done may invalidate what I was talking about. Just keep that in mind if you do decide to try this out.

Here are some other tools that are interesting to think about when dealing with content deployment:

Conveyor is a young package (at least right now it is). It has a dashboard that you would be able to use to selectively export content from your production site. You can then log in to the backoffice on your staging site and import the content. I am trying this out for the first time this month. It looks very promising, so far, but I can't give you a lot of advice from experience.

Courier is meant to be the ultimate solution in content deployment. It is one of the few content deployment options that allows you to selectively deploy only the content you want to. You can right click on content and deploy from staging to production or from production to staging. Courier also tries to detect dependencies and deploy them along with your content selections. The trick with Courier is that when something goes wrong, it is a big deal. Sites can go down and depending on what went wrong, it could take a lot of time to recover them. Courier might try to deploy a document type that it detected as a dependency and accidentally ruin things. I've also found that it requires a lot of training to use properly. I haven't had a lot of success allowing non-technical folk to use Courier. If you use Courier, set up a test environment and play around for a while. Make sure you know what workflows work for you and what will break things. Courier will let you shoot yourself in the foot. Update: Umbraco has been using Courier a lot for their new Umbraco as a service. They have been finding and fixing a lot of the bugs. The 2015 versions of Courier are much more stable. If you want to use Courier, Make sure you are using the newest versions for Umbraco 7. I've recently been doing some testing on Courier version 2.50.1. Much, much better. I'd still tread carefully though. Another Update Umbraco has been depending more and more heavily on Courier. They have announced a new and reworked Courier called Umbraco Deploy. I look forward to it. Once it is released, that will be a better choice than Courier and I expect that it will function similarly.

Umbraco Cloud is a whole SaaS setup that Umbraco has been working on very heavily. They can host your Umbraco site in Azure and have a very neat UI and process for deploying not only the content and media of your site but also all of the code, document types, and data types. This is still somewhat new, and a lot of very complex sites may not be a good fit for Umbraco Cloud. Also sites that rely heavily on document type inheritance vs document type composition might have problems. As far as I can tell, Umbraco Cloud is nice for small to medium sized sites, but Umbraco does have some very very large sites hosted on Umbraco Cloud as well. Umbraco Cloud relies heavily on the new Umbraco Deploy that is based off of Courier. Chances are that if your site is having trouble with the new Courier, it will still have problems on Umbraco Cloud. uMirror is one that I've never used, but it exists and could be useful.

uSync Content Edition is another one that I've never used. We do have experience using the regular uSync, and I've found that the author is very responsive to issues and questions.

Blowup answered 8/5, 2015 at 17:5 Comment(3)
Do you know at all what has changed in the latest version of Courier? I've found the same as you - when it goes wrong, it really goes wrong. I've tried to find details and release notes but have had no luck.Germann
I don't know what they changed in specific. I've tested as far up as Courier v2.50.1 for Umbraco 7. I haven't had experience working with it in the wild, yet. Just tried to break it the same ways that I could in the older versions on some dev sites I propped up. It felt much more stable, and I had trouble breaking it. Umbraco has been relying on Courier heavily for their Umbraco as a Service project. They felt the pain themselves, and have put a lot of work into fixing it. All that being said, I would still treat Courier with caution until it has proven itself to you.Blowup
I spoke to one of the chaps on the team the other day, the latest version strips outa lot of the complexity of courier of old. Now it's a bit more like a rubber stamp and moves, like for like, between stanging and production. There are edges cases that still don't work, like dictionary items. If only they'd use GUIDS as Ids like the enterprise CMSs do, life would be much simpler.Germann
K
2

It sounds like you are seeking something like uSync.ContentEdition, which will allow you to export the database content to disk. You can copy the files over to staging, and then import them into the database. Be careful though, the author himself states that it is "Experimental (but getting better)".

An alternative option would be to copy the database itself from live to staging every so often, assuming that the staging database can be overwritten. This is the approach I would take.

Kamal answered 28/11, 2014 at 9:43 Comment(1)
uSync is not even remotely ready for a real development team or a production Umbraco instance. The author is quite responsive to issues, however there are so many of them. For example, all media Ids get updated during an import, so any references to images on the site will be broken, since the reference uses the old id, but uSync created a new one during import. uSyn doesn't handle deleting files (content or doc types) very well. Imports into other environments can lead to inconsistent results. Our project team has started calling uStink due to all the problems we have had...Bronchopneumonia

© 2022 - 2024 — McMap. All rights reserved.