You will be redirected in 30 seconds or close now.

ColdFusion Authors: Yakov Fain, Jeremy Geelan, Maureen O'Gara, Nancy Y. Nee, Tad Anderson

Related Topics: ColdFusion, Adobe Flex

ColdFusion: Article

Isn't It About Time to Dump CF5?

Going from CF5 to CFMX7

A new project just landed on my desk. This is not a maintenance project; it's brand new, start from scratch, development. The client asked me to build a site in ColdFusion 5. It's my fourth project in the past year that's based on a legacy version of CF. I could have saved the client both time and money by building it in CFMX, since I have a lot of the functionality pre-built as ColdFusion Components. But CFCs don't work in CF5, so those pre-built components are pretty useless. There's no better time to upgrade than right now; in this article I thought I'd show you the process I'd take when upgrading a server from CF5 to CFMX7.

The Upgrade
There are compelling reasons to get off CF5. For developers, it's the use of CFCs that let you build more maintainable code. For business folk, it's support. It's harder to find CF5-based developers and I suspect that when CFMX8 comes out, support for CF5 will drop. If they follow an 18-month release schedule, then I'm sure it will happen within the next year. Other niceties like PDF generation and event gateways make the upgrade more appealing. So let me step you through the process.

First download the latest version of ColdFusion. You can do so from the Adobe Web site. The J2EE version is a slightly different beast so I'll just step you through the standard install. It's closest to the CF5 installation. The J2EE version, if you already have a J2EE server, can create multiple isolated ColdFusion instances. This is great if you have to isolate apps from each other, but I don't usually use this. You can get the same functionality from the multi-server install (and it's easier to manage).

Launch the install program, and follow these steps:

  1. Select your language and click Okay. Read the introduction note. There are no decisions to make on this screen so click Next. Read through the license agreement and select "I agree" then click Next. These were the easy steps.
  2. Enter your license number or select the trial/developer edition. For this example, the developer edition is okay. Select it, and click Next.
  3. This screen in Figure 1 lets you select which version to install. I've already mentioned versions, but you can read more details about them in the livedocs at http://livedocs.macromedia.com/coldfusion/7/htmldocs/00000003.htm#1211441. Select "server" and click Next.
  4. This screen lets you select the sub-components you want to install. There are three options, the documentation, the search services, and the ODBC services. I won't install the tutorials or documentation on a production server, but I usually keep the other two. On a dev server I usually install it all. Click Next.
  5. Select the directory that you want to install to. I usually keep the default. Click Next.
  6. A previous version was detected, as shown in Figure 2. You can use the built in the Web server or reconfigure the existing Web server. We want to reconfigure. Click Next. The installer will detect your Web server. You're given the option of configuring multiple Web sites. On Windows XP, IIS doesn't let you have multiple Web sites, so select Update All and click Next. Enter your Web root and click Next.
  7. Enter the password for the ColdFusion Administrator. Click Next and enter the password for RDS. Click Next.
  8. You'll get a summary of the install options, as shown in Figure 3. Review them and click Install. ColdFusion will start installing. Go top off your drink of the day (coffee, water, or vodka).
  9. When you come back, CF should be installed.
Now that ColdFusion is installed, you have to configure it. This happens the first time you open the ColdFusion Administrator, or you could select the checkbox on the final install screen to do the configuration manually. Click Done (and check the box) to enter the configuration wizard, as shown in Figure 4.
  1. Enter your ColdFusion Administrator password and click Login.
  2. ColdFusion will chug for a bit and then give you the option of migrating your settings. You probably want to do this, so click Next. If you want to start CFMX new and configure it as needed you can skip this.
  3. You'll see a list of items that can be migrated. Datasources, verity collections, and mappings are just some of them. Click Next.
  4. ColdFusion will chug some more. It will let you know if there are any problems. Click Next to start the migration.
  5. Once again, the setup wizard chugs and lets you know that things were done. Click Ok to open the Getting Started experience (if you installed he samples / documentation).
The Code Analyzer
Before upgrading a production machine, you might want to test your apps on a development machine first. I strongly recommend it, especially when moving from ColdFusion 5 to ColdFusion MX. ColdFusion 5 was built on a C++ architecture, whereas CFMX is on top of J2EE. These changes in underlying structure introduced a few oddities to the language. Most of your code will work without a problem, and there are many upgrade success stories. But, for those few gotchas it's good to test. To help alleviate the migration problem, the ColdFusion administrator includes a code analyzer. It will examine your code and help isolate problems or potential problems. (The code analyzer also helps if you're just upgrading from CFMX to CFMX7, although you're less likely to have serious issues). Once ColdFusion's installed, launch the administrator and sign in. Select Code Analyzer under the "Debugging and Logging" menu. You'll see a screen like Figure 5.

Enter the name of your directory, the type of files to analyze, and click the run analyzer option. For the file types, most likely you'll be analyzing cfm files and therefore want to use the default "*.cfm" as the type. If you've used some tricks on the Web server to make ColdFusion process files with alternate extensions such as HTML then you'll want to add those extensions here. Click the advanced options feature, and you'll see Figure 6. This lets you specify which tags, functions, or issues to look for in your code. Normally, I'd just use the basic option, but if you need this kind of granular control it's there.

Click Run Analyzer and you should a list similar to Figure 7. (Or maybe you code perfectly and get nothing returned.) You can sort the listing by clicking on the column headers. Click the first icon to see a detailed report of the errors. Click on the second to see a file specific.

I don't recommend using the code analyzer as a substitute for doing quality assurance tests on your apps, but it's a good starting point to figure out what areas may need code changes.

Here are some of the most common issues I've faced when upgrading:

  • Security Model: The security model changed in moving off the C code base. Many tags and functions related to the CF5 way of doing things have been rendered obsolete. Tags such as cfauthenticate and cfimpersonate are gone. Functions such as isAuthorized, isAuthenticated, and AuthenticatedUser are gone. Take a look at cflogin and cfloginuser for information on ColdFusion's new security features. (You didn't use that old security framework anyway, did you?)
  • Monitor Errors: CF5 had an error type for the cferror called monitor. Monitor was so you could follow specific error types. It trumped cftry / cfcatch blocks. This kind of error handling is gone.
  • Graphing: cfgraph and cfgraphdata are gone. Instead look at cfchart, cfhartdata, and cfhartseries.
  • Dynamic Database Access: ColdFusion 5 lets you use connections strings to connect to the database. This was useful in many cases, especially shared hosting environments and preventing other people on your server from guessing your DSN and getting access to all of your data. Connection strings were added to BlueDragon.net, but with ColdFusion the best you're going to get is a security sandbox that restricts database access.
  • Registry Access: The cfregistry tag no longer works on Unix machines. Unix doesn't have a registry in the same way that ColdFusion does; so that's not a surprise.
  • Periods in the Variable Name: In CF5, the period was valid in a variable name. In CFMX, a structure will be created. The text before the period will be the structure name and the text after the period will be the key. This is called dot notation and is similar to how you access many values in CF, such the results of a query set.
  • ODBC: This is more of a configuration issue than a coding issue. In CF5, ColdFusion could access datasources created in the ODBC control panel by default. Since CFMX is Java-based, it uses JDBC instead of ODBC. You can access control panel databases uses an ODBC bridge, or connect to the database directly using the JDBC drivers included.
There's some documentation included with CFMX6 that talks about migrating from 5 to MX. It's worth a read since it goes into more depth than this article. Check it out at http://livedocs.macromedia.com/coldfusion/6/ Migrating_ColdFusion_5_Applications/cf_migration_guide.htm.

Final Thoughts
It seems weird to be writing about this so long after the initial release of CFMX. I look forward to the day when I can remove CF5 from my machine and clients will stop asking me for version 5-compatible code (I've started turning down requests for 4.5 development). Until then, I keep ColdFusion 5, ColdFusion MX, and BlueDragon running side-by-side. This is beneficial when it comes to migrating apps between versions or testing code for cross-version compatibility. I described this set up in an article I co-wrote with Charlie Arehart at http://coldfusion.sys-con.com/read/42069.htm. Although it's a bit dated, all the techniques still apply.

More Stories By Jeffry Houser

Jeffry is a technical entrepreneur with over 10 years of making the web work for you. Lately Jeffry has been cooped up in his cave building the first in a line of easy to use interface components for Flex Developers at www.flextras.com . He has a Computer Science degree from the days before business met the Internet and owns DotComIt, an Adobe Solutions Partner specializing in Rich Internet Applications. Jeffry is an Adobe Community Expert and produces The Flex Show, a podcast that includes expert interviews and screencast tutorials. Jeffry is also co-manager of the Hartford CT Adobe User Group, author of three ColdFusion books and over 30 articles, and has spoken at various events all over the US. In his spare time he is a musician, old school adventure game aficionado, and recording engineer. He also owns a Wii. You can read his blog at www.jeffryhouser.com, check out his podcast at www.theflexshow.com or check out his company at www.dot-com-it.com.

Comments (2) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.

Most Recent Comments
R Martin Ladner 06/08/06 05:24:28 PM EDT

- We host a site that started off nicely in ColdFusion (4.5 -> 5) but has the misfortune to have been added to in whatever language the latest contract programmer liked. (We keep it available and do remedial programming; another firm has the contract for routine programming of major modules.) Thus although the initial functionality (and most of the admin services) are handled by ColdFusion (5), it also provides functionality using ASP, Java Servlets, and Java Server Pages. The most fragile portions of the site are the ones relying on specific java configurations. (Yes, there are several.) Installing yet another java environment has the potential to kill the whole thing.
- I'm not anxious to spearhead a transition to CFMX. I'd like Java to settle down to where frequent updates aren't needed for the infrastructure. And, I'd like JDBC to become a bit more mature before I have to rely on it for the portions of the application that have been rock solid (via CF 5 and ODBC) thus far. =Marty=

CFDJ News Desk 06/03/06 04:21:11 PM EDT

A new project just landed on my desk. This is not a maintenance project; it's brand new, start from scratch, development. The client asked me to build a site in ColdFusion 5. It's my fourth project in the past year that's based on a legacy version of CF. I could have saved the client both time and money by building it in CFMX, since I have a lot of the functionality pre-built as ColdFusion Components. But CFCs don't work in CF5, so those pre-built components are pretty useless. There's no better time to upgrade than right now; in this article I thought I'd show you the process I'd take when upgrading a server from CF5 to CFMX7.

IoT & Smart Cities Stories
The challenges of aggregating data from consumer-oriented devices, such as wearable technologies and smart thermostats, are fairly well-understood. However, there are a new set of challenges for IoT devices that generate megabytes or gigabytes of data per second. Certainly, the infrastructure will have to change, as those volumes of data will likely overwhelm the available bandwidth for aggregating the data into a central repository. Ochandarena discusses a whole new way to think about your next...
CloudEXPO | DevOpsSUMMIT | DXWorldEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
All in Mobile is a place where we continually maximize their impact by fostering understanding, empathy, insights, creativity and joy. They believe that a truly useful and desirable mobile app doesn't need the brightest idea or the most advanced technology. A great product begins with understanding people. It's easy to think that customers will love your app, but can you justify it? They make sure your final app is something that users truly want and need. The only way to do this is by ...
Digital Transformation and Disruption, Amazon Style - What You Can Learn. Chris Kocher is a co-founder of Grey Heron, a management and strategic marketing consulting firm. He has 25+ years in both strategic and hands-on operating experience helping executives and investors build revenues and shareholder value. He has consulted with over 130 companies on innovating with new business models, product strategies and monetization. Chris has held management positions at HP and Symantec in addition to ...
DXWorldEXPO LLC announced today that Big Data Federation to Exhibit at the 22nd International CloudEXPO, colocated with DevOpsSUMMIT and DXWorldEXPO, November 12-13, 2018 in New York City. Big Data Federation, Inc. develops and applies artificial intelligence to predict financial and economic events that matter. The company uncovers patterns and precise drivers of performance and outcomes with the aid of machine-learning algorithms, big data, and fundamental analysis. Their products are deployed...
Dynatrace is an application performance management software company with products for the information technology departments and digital business owners of medium and large businesses. Building the Future of Monitoring with Artificial Intelligence. Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more busine...
Cell networks have the advantage of long-range communications, reaching an estimated 90% of the world. But cell networks such as 2G, 3G and LTE consume lots of power and were designed for connecting people. They are not optimized for low- or battery-powered devices or for IoT applications with infrequently transmitted data. Cell IoT modules that support narrow-band IoT and 4G cell networks will enable cell connectivity, device management, and app enablement for low-power wide-area network IoT. B...
The hierarchical architecture that distributes "compute" within the network specially at the edge can enable new services by harnessing emerging technologies. But Edge-Compute comes at increased cost that needs to be managed and potentially augmented by creative architecture solutions as there will always a catching-up with the capacity demands. Processing power in smartphones has enhanced YoY and there is increasingly spare compute capacity that can be potentially pooled. Uber has successfully ...
SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things'). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing. IoT is not about the devices, its about the data consumed and generated. The devices are tools, mechanisms, conduits. This paper discusses the considerations when dealing with the...