Welcome!

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.

@ThingsExpo Stories
Announcing Poland #DigitalTransformation Pavilion
Digital Transformation is much more than a buzzword. The radical shift to digital mechanisms for almost every process is evident across all industries and verticals. This is often especially true in financial services, where the legacy environment is many times unable to keep up with the rapidly shifting demands of the consumer. The constant pressure to provide complete, omnichannel delivery of customer-facing solutions to meet both regulatory and customer demands is putting enormous pressure on...
DXWorldEXPO LLC announced today that All in Mobile, a mobile app development company from Poland, will exhibit at the 22nd International CloudEXPO | DXWorldEXPO. All In Mobile is a mobile app development company from Poland. Since 2014, they maintain passion for developing mobile applications for enterprises and startups worldwide.
CloudEXPO | 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.
The best way to leverage your CloudEXPO | DXWorldEXPO presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering CloudEXPO | DXWorldEXPO will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at CloudEXPO. Product announcements during our show provide your company with the most reach through our targeted audienc...
@DevOpsSummit at Cloud Expo, taking place November 12-13 in New York City, NY, is co-located with 22nd international CloudEXPO | first international DXWorldEXPO and will feature technical sessions from a rock star conference faculty and the leading industry players in the world.
Everything run by electricity will eventually be connected to the Internet. Get ahead of the Internet of Things revolution. In his session at @ThingsExpo, Akvelon expert and IoT industry leader Sergey Grebnov provided an educational dive into the world of managing your home, workplace and all the devices they contain with the power of machine-based AI and intelligent Bot services for a completely streamlined experience.
DXWorldEXPO | CloudEXPO 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.
22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud ...
In his keynote at 19th Cloud Expo, Sheng Liang, co-founder and CEO of Rancher Labs, discussed the technological advances and new business opportunities created by the rapid adoption of containers. With the success of Amazon Web Services (AWS) and various open source technologies used to build private clouds, cloud computing has become an essential component of IT strategy. However, users continue to face challenges in implementing clouds, as older technologies evolve and newer ones like Docker c...
"MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
JETRO showcased Japan Digital Transformation Pavilion at SYS-CON's 21st International Cloud Expo® at the Santa Clara Convention Center in Santa Clara, CA. The Japan External Trade Organization (JETRO) is a non-profit organization that provides business support services to companies expanding to Japan. With the support of JETRO's dedicated staff, clients can incorporate their business; receive visa, immigration, and HR support; find dedicated office space; identify local government subsidies; get...
Dion Hinchcliffe is an internationally recognized digital expert, bestselling book author, frequent keynote speaker, analyst, futurist, and transformation expert based in Washington, DC. He is currently Chief Strategy Officer at the industry-leading digital strategy and online community solutions firm, 7Summits.
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...
In past @ThingsExpo presentations, Joseph di Paolantonio has explored how various Internet of Things (IoT) and data management and analytics (DMA) solution spaces will come together as sensor analytics ecosystems. This year, in his session at @ThingsExpo, Joseph di Paolantonio from DataArchon, added the numerous Transportation areas, from autonomous vehicles to “Uber for containers.” While IoT data in any one area of Transportation will have a huge impact in that area, combining sensor analytic...
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...
Charles Araujo is an industry analyst, internationally recognized authority on the Digital Enterprise and author of The Quantum Age of IT: Why Everything You Know About IT is About to Change. As Principal Analyst with Intellyx, he writes, speaks and advises organizations on how to navigate through this time of disruption. He is also the founder of The Institute for Digital Transformation and a sought after keynote speaker. He has been a regular contributor to both InformationWeek and CIO Insight...
Michael Maximilien, better known as max or Dr. Max, is a computer scientist with IBM. At IBM Research Triangle Park, he was a principal engineer for the worldwide industry point-of-sale standard: JavaPOS. At IBM Research, some highlights include pioneering research on semantic Web services, mashups, and cloud computing, and platform-as-a-service. He joined the IBM Cloud Labs in 2014 and works closely with Pivotal Inc., to help make the Cloud Found the best PaaS.
It is of utmost importance for the future success of WebRTC to ensure that interoperability is operational between web browsers and any WebRTC-compliant client. To be guaranteed as operational and effective, interoperability must be tested extensively by establishing WebRTC data and media connections between different web browsers running on different devices and operating systems. In his session at WebRTC Summit at @ThingsExpo, Dr. Alex Gouaillard, CEO and Founder of CoSMo Software, presented ...
I think DevOps is now a rambunctious teenager - it's starting to get a mind of its own, wanting to get its own things but it still needs some adult supervision," explained Thomas Hooker, VP of marketing at CollabNet, in this SYS-CON.tv interview at DevOps Summit at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.