On a recent project, we had a requirement to tear up /down the Episerver CMS database fairly frequently. On a usual project, one of the first tasks I'd normally add to the backlog and I recommend that you do, is to get rid of any manual steps that your workflow might require. If you're quick on time, I've even written a little app that will do most of the hard work for you. If you want to learn more about that then I recommend you have a look at this article, A C# App That Will Wipe Your Eiiserver Database
On this particular project, the website in question was an old legacy site built by a different company. First, the old company's code base wasn't written very well, it wasn't testable and wasn't built with a tear-up/tear-down mindset. I didn't work at the old client, so I can't comment on the reasons etc.. but our job was to get a website running based on this limitation.
The timescales on the project were very tight, so much so that the time wasn't available for the company to do all the automation stuff fully before the project went live.
For this reason, I've found myself for the first time in many years, manually dropping and repopulating my Episerver websites sometimes on a nearly daily basis on various servers. As with any manual deployment process being performed in different environments, with a complex commerce website that was originally built without the thought of tearing up/tearing down, mistakes creep in etc.. and errors occur. The aim of this post is to hopefully help people out there save some time.
Document All Your Deployment Processes
Before I kick off with the code, first I'd recommend that you go to confluence and write a step-by-step guide of every manual thing you need to do, in order to deploy your website, re-populate it with data etc..
If you haven't read the Phoenix project I suggest you do that, as in there, there's an easy to understand explanation about why getting visibility on processes:
It allows other developers to replicate the tasks with fewer errors
It gives the business greater visibility as to where your time is going and gives you better justifications for spending time automating things.
In my situation, the deployment process was 16 steps and if not followed correctly, then strange errors occurred, which I'll cover next.
The file '/link/43F936C99B234EA397B261C538AD07C9.aspx' does not exist.
Before I begin going into this one, let me say this website was a multi-language website. For people using Episerver for a while, you might think that the error is down to missing media in the blog storage, but it isn't. This error means EPiserver can't find a start page.
Go to your site definition folder and ensure that the start page is set.
I Get A 503 Sevice Unavailable Error When My Episerver Start Page Loads
A 500 type Error Is Usually A Configuration Issue. In these instances, nothing will log within the Epi-logs. 500 logs can be found in the Windows application logs. 90% of the time these errors mean there's something wrong with your web.config
This usually happens the first time you try to install a website on a new server. If this is you, then I'd recommend reading, Getting A 503 Sevice Unavailable Error When My Episerver Start Page Loads
My Page Is Blank
This is usually down to the site definitions not being set-up correctly, or, in a multi-language website, your culture hasn't been set. In the site definition:
Ensure that the hostname you are using to access your Episerver website is mapped in the site definitions AND the correct language has been set (if applicable)
BONUS TIP: If your site settings look ok, but still don't work, delete and re-create. On a recent project, the website's site definitions were being built up in code (see here to do that) and looked correct and set-up as expected, although the site didn't load. Someone on the team deleted the site definitions which made the site work again. So my tip is, if you think the issue is down to your site definitions, don't be afraid to delete and re-create it as a test.
My Page Sill Isn't Loading
If you're reading this and your page still isn't loading, then it's likely a code based issue. If you're running out of ideas for things to try, then here are a few points for consideration:
- Can you access a static HTML file in your webroot via a browser? If not it's an environment issue
- Can you access another Episerver page, e.g. the search-page etc.. It could be your homepage template has an issue
- Does the Windows event log have anything?
- Have the Episerver logs logged anything useful?
- Does your view HTML return anything?
- Is your App_data directory pointing to a valid location?
- Does Chrome inspect console/network show any 404/errors?
- Do you have a valid Episerver license? This won't break a page but can break JS on the page
Episerver Startpage Not Loading Takeaway
Most Episerver websites are quick and easy to get up and running, some aren't. If you're struggling to set-up your website, I suggest you invest the time automating it, whether it be through a build server, a custom exe you run locally to set everything up, or you do it all on the project's post-build action.
If your page doesn't load properly, aside from environment configuration on a new server, the site definitions and language are the most common issues. If that doesn't fail, hopefully, some of the pointers above might help, if not... good luck!