I was *the* expert at my company for our original products -- standalone database applications developed in the days of MSDOS. Although I was second-generation (apart from a smaller application I wrote myself), the original developers had long since moved on and for 15 years I held court. I knew every source file and every bug by name; I could crank out modifications at a moment's notice; I was sole technical support for the final 5 years of the products' existence.
Suddenly management realized that we didn't have enough customers on the legacy products to need me doing a combination code maintenance / support any more, and there was a scramble to find a new spot for me.
My big mistake was not staying current in the technology. Suddenly it was 2010 and I still knew only the most rudimentary basics of HTML, CSS, VB, and SQL. The only thing that saved me was the goodwill I had built up over the previous 18 years; various managers were patient with me while I scrambled to learn JavaScript, ASP.NET, and jQuery.
After four years with those platforms (and buffing up my SQL skills) I'm back to the point that can at least consider myself "intermediate"... and the playing field is changing again. We're moving away from JavaScript/jQuery and into JavaScript/Angular on the front end and C# on the back. Not to mention a side helping of vCloud, Attunity for SQL Server, and TFS 2013. Once again I'm a complete novice, struggling to learn stuff that the newcomers already knew before they were hired.
Look upon me with horror and beware, kids: Don't wait for your job description to change before you start learning new technology. Dive into it NOW, so you'll be ready when your current skill set is obsolete.