Migrating ColdFusion 5.0 Applications


Let's say you've developed a ColdFusion Server 5.0 application, and you want to migrate to ColdFusion MX. While migrating, you may encounter some problems due to incompatibility between the two versions. To overcome this, you need to develop a migration plan.

Creating a Migration Plan

It's recommended that you develop a structured migration plan to facilitate the migration process. The migration plan differs for every application because it depends on the deployment environment. Here are some tips to keep in mind while creating the migration plan:

  • Archive and deploy the existing ColdFusion 5.0 applications to another ColdFusion Server, which can act as a test server.

  • Migrate the databases to the test server. In addition, you need to migrate the data sources in the ColdFusion 5.0 applications to ColdFusion MX.

  • Ensure that the ColdFusion Server 5.0 application is running on the test server before you migrate to ColdFusion MX.

  • Test the ColdFusion Server 5.0 application using the Code Compatibility Analyzer component.

Using the Code Compatibility Analyzer

The Code Compatibility Analyzer component used in ColdFusion MX addresses any compatibility issues in the ColdFusion Server 5.0 application. It validates the CFML syntax of the ColdFusion application. To do so, the analyzer runs the ColdFusion compiler on the pages and reports any errors that the compiler encounters. However, it doesn't execute the compiled code. In addition, it identifies certain-places in which ColdFusion MX may behave differently when compared to ColdFusion Server 5.0.

The analyzer includes the following features:

  • No Longer Supported. This feature results in an error. There might be some tags or functions that are no longer supported by ColdFusion MX. For instance, the cflog tag generates an error with the thread=Yes attribute.

  • Deprecated. This feature indicates that CFML elements, such as tags and functions, are still available, but it's not recommended that you use them.

  • Modified Behavior. This feature indicates that CFML elements, such as cfapplet and cfapplication tags, might behave differently when used in ColdFusion MX.

You can run the Code Compatibility Analyzer using the ColdFusion MX administrator. To do so, select the Code Analyzer option from the list displayed in the Debugging and Logging section. This displays the CFML Code Analyzer page, as shown in Figure 8.1.

click to expand
Figure 8.1: The CFML Code Analyzer page.

Select the virtual directory in the Web server using the Browse Server button, and then click the Run Analyzer button. This displays the CFMX Compatibility Report, which displays the number of errors generated while analyzing the CFMX code. If the error isn't generated, it displays Zero Error Found. You can even reanalyze the CFMX code for MX compatibility.

Note

The analyzer cannot check for any invalid attributes because it only checks for compatibility issues and doesn't execute the applications.

Here are some of the guidelines that you need to follow while using the Code Compatibility Analyzer:

  • Don't run the Code Compatibility Analyzer on multiple application directories. This is to avoid time-consuming operations and degraded server performance over a period of time.

  • Turn off the CFML validation option in the Code Compatibility Analyzer administration page when testing only for ColdFusion MX incompatibilities.

  • Turn on the CFML validation option to validate the CFML syntax.

The next section provides an overview of migrating the settings of ColdFusion MX.

Using the Settings Migration Wizard

If you install ColdFusion MX on the same computer as the ColdFusion Server 5.0, you're prompted to migrate the ColdFusion Server 5.0 settings to ColdFusion MX. After the setup is complete, the ColdFusion Administrator starts automatically for the first time and prompts you to migrate the settings to ColdFusion MX. It displays the Internet Explorer window that allows you to migrate the administrative settings of ColdFusion Server 5.0 to ColdFusion MX, as shown in Figure 8.2.

click to expand
Figure 8.2: Migrating the administrative settings.

Click Continue on the Internet Explorer window to start migrating the settings of ColdFusion Server 5.0 to ColdFusion MX, as shown in Figure 8.3.

click to expand
Figure 8.3: Running the migration settings.

Note

If you run the setup wizard on the Unix operating system, you're prompted to migrate the ColdFusion settings the first time you open the ColdFusion Administrator.

You can choose to skip the migration and do it later. However, it's recommended that you run the Settings Migration wizard immediately after installation. Otherwise, it might later overwrite the new ColdFusion MX settings, because the wizard copies the settings from the ColdFusion Server 5.0 configuration.

Limitations of the Settings Migration Wizard

Table 8.3 lists certain limitations of the Settings Migration wizard.

Table 8.3: Limitations of the Settings Migration Wizard

Limitation

Solution

Prevents the migration of the CORBA connector settings

Manually reconfigure the connector settings

Prevents the migration of DB2

Re-create the data sources after installing ColdFusion MX datasources

Incorrectly sets port value in the JDBC

Edit the data source in the ColdFusion MX administrator to include the correct Type IV Informix driver port value

Migrating CFML Elements in ColdFusion MX

ColdFusion Server 5.0 has certain tags, attributes, functions, variables, and database operations for performing CFML tasks. However, some of these CFML elements are now either obsolete in ColdFusion MX or have been modified. This section discusses some of those CFML elements that have been modified in ColdFusion MX.

CFML Tags and Attributes

ColdFusion Server 5.0 includes certain tags and attributes that have been modified in ColdFusion MX. Table 8.4 lists some of these tags, with the modifications.

Table 8.4: Modified Tags and Attributes

Tag

Modification

cfcol

Displays the header as TRUE if you use the cfcol header attribute without any text.

cfform

Uses the checked attribute of the cfinput tag if the corresponding form field value is undefined.

cfindex

Uses the cfindex tag along with the query attribute and type="file" or type="path".

cflog

Has a default value of Yes. If set to No, ColdFusion MX throws a runtime exception. The thread, date, and time attributes of this tag are obsolete in ColdFusion MX.

cfparam

Disallows the assignments of the complex datatypes.

cfreport

Does not manage the data connection for a crystal report.

cfswitch

Does not include the code inside the cfswitch tag that's not in a cfcase or cfdefaultcase tag. ColdFusion Server 5.0 ignores the code, whereas ColdFusion MX throws a compilation error.

CFML Variables and Functions

Apart from tags and attributes, there are certain functions and variables in ColdFusion MX that have been modified. For example, the DeleteClientVariable returns FALSE when the variable doesn't exist in ColdFusion MX, and the GetBaseTagList function returns the prefixed custom tags found in the tag stack in the format x:tag.

Database Operations in ColdFusion MX

ColdFusion MX uses the JDBC drivers to interact with the databases and to perform operations, such as querying, writing, and updating a database. ColdFusion MX no longer uses the JDBC-ODBC bridge driver to connect to the Open Database Connectivity (ODBC) data sources. Instead, you can use the bundled Merant Type 4 database drivers or SQL Link Type 3 database drivers to perform this task. In the ColdFusion Server 5.0, unlike ColdFusion MX, an ODBC DSN entry created using the ODBC Data Source Administrator automatically appeared in the list of data sources in the ColdFusion Administrator. You have to create the ODBC DSN entry in the ColdFusion MX Administrator manually:

  1. Click the Data Sources option from the Data & Services section of the ColdFusion MX Administrator window.

  2. In the Add New Data Source Name section, enter a data source in the Data Source Name text box, and select the driver from the Driver drop-down list.

  3. Click the Add button. Enter the database name and the other relevant details, and then click the Submit button.

Migrating the Localization Settings in ColdFusion MX

ColdFusion MX supports character code values between 0-65535, whereas ColdFusion Server 5.0 supports only 1–255. This affects the string-processing functions used in ColdFusion Server 5.0. In addition, ColdFusion MX recognizes new currency formats for new locales. For instance, when you use the Euro currency into the LSIsCurrency function, ColdFusion MX returns Yes if the locale is the Euro member and vice versa. Table 8.5 lists some of the locales and their currency formats.

Table 8.5: Locales and Their Currency Formats

Locale

Currency Format

English(Australian)

AUD 123,456.78

English(Canadian)

CAD 123,456.78

English(New Zealand)

NZD 123,456.78

Portuguese(Standard)

123,456.78 Esc., PTE123.456,78

French(Canadian)

123,456, 78; 123 456,78 $; CAD123 456,78

You can use the Java standard locale formatting rules in ColdFusion MX on all of the platforms, unlike in ColdFusion Server 5.0. Some functions in ColdFusion MX produce different results than in ColdFusion Server 5.0. For instance, in ColdFusion MX, the LSCurrencyFormat() function returns the correct international currency code for the countries other than the U.S.




Macromedia ColdFusion MX. Professional Projects
ColdFusion MX Professional Projects
ISBN: 1592000126
EAN: 2147483647
Year: 2002
Pages: 200

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net