Migration - Upgrades

How to Prepare a Migration Plan for ColdFusion Applications

Contents show

Why a structured Migration plan matters

ColdFusion applications often run business‑critical workflows that touch Authentication, Data processing, reporting (PDF/cfdocument), and scheduled integrations. Leaving them on outdated runtimes can expose you to Security vulnerabilities, unsupported JVMs, fragile connectors, and Performance bottlenecks. A thoughtful plan reduces downtime, controls risk, and creates a repeatable path for future upgrades—whether you move to a newer Adobe ColdFusion release, modernize on Lucee, change operating systems, or containerize on Docker/Kubernetes.


Prerequisites / Before You Start

Supported platforms and versions

  • Identify your current stack:

    • ColdFusion engine: Adobe ColdFusion (version/build) or Lucee (version).
    • Java/JDK version and vendor (e.g., Temurin, Oracle).
    • Application server: Tomcat version bundled with CF.
    • OS: Windows Server, Linux distro/version.
    • Web server and connector: IIS, Apache httpd (mod_proxy/mod_jk), Nginx, AJP/HTTP proxy connectors.
    • Database and JDBC drivers (MSSQL, Oracle, MySQL/MariaDB, PostgreSQL).
    • Other dependencies: Solr, Redis, Elasticsearch, mail server, S3/Azure Blob, PDF fonts.
  • Determine the target platform:

    • Target CF engine and version (e.g., Adobe ColdFusion 2023 or Lucee 6.x).
    • Supported JDK for that engine. Always verify with the vendor’s Compatibility matrix.
    • Hosting model: VM/bare metal vs containers; on‑prem vs cloud.

Inventory and dependency mapping

Backups and recovery

  • Full system snapshot: CF installation directory, webroot(s), CFIDE/custom admin extensions, logs.
  • Code repository: ensure source control is complete and current.
  • Configuration exports:
    • Adobe CF: use CAR (ColdFusion Archive) or cfsetup to export settings to JSON.
    • Lucee: export server/web admin settings; back up lucee-server/context and lucee-web/context.
  • Database backups: consistent, restorable snapshots with tested point‑in‑time recovery.
  • License keys, installer media, and Docker image digests stored securely.

Access and tooling

  • Administrative access to servers, DNS, SSL/TLS certificates and keystores.
  • Command-line tools:
    • Adobe: cfsetup, cfpm (ColdFusion Package Manager), wsconfig.
    • Lucee: CommandBox, CFConfig.
    • Build/test: Git, TestBox, Jenkins/GitHub Actions, JMeter/k6.
  • Monitoring/observability: FusionReactor, New Relic, Elastic Stack, Prometheus.
See also  How to Switch from ColdFusion to Modern CFML Frameworks

Step-by-Step Migration plan

1. Define the migration scope and target Architecture

  • Decide on upgrade vs replatform:
    • Upgrade Adobe ColdFusion to a newer release, or Migrate to Lucee.
    • Move from 32‑bit to 64‑bit where applicable.
    • Consider container images for reproducible environments.
  • Align on topology:
    • Single node vs clustered CF instances.
    • Session Storage strategy (in‑memory, Redis, database).
    • Web server and connector model: AJP vs HTTP proxy with sticky sessions.
  • Document SLAs (RTO/RPO), expected downtime, and change window.

2. Build a reproducible environment

  • Use Infrastructure as code:
    • Packer/Terraform for VMs, Dockerfiles/Compose/Helm for containers.
  • Create dev/test/stage environments mirroring production:
    • Same CF version/build, same JDK major, similar memory/CPU.
  • Seed test data subsets; isolate external integrations with mocks.

3. Baseline and prepare the codebase

  • Static analysis and compatibility review:
    • Run CFLint or IDE inspections to flag Deprecated tags/functions.
    • For Adobe CF, use the Code Analyzer; for Lucee, review unsupported Adobe‑specific Features.
  • Instrumentation:
  • Tighten Application.cfc:
    • Centralize settings (sessionManagement, this.datasource, encodings).
    • Avoid application‑wide side effects in onApplicationStart that depend on environment state.

Example Application.cfc (minimal, environment-friendly):

component {
this.name = “MyApp”;
this.sessionManagement = true;
this.sessionTimeout = createTimeSpan(0,0,30,0);
this.datasource = “MainDSN”;
this.charset = “UTF-8”;
this.scriptProtect = “all”;

function onApplicationStart() {
application.build = getSystemProperty(“app.build”,”dev”);
}
}

4. Plan JVM and runtime alignment

  • Choose a supported JDK (vendor and major version) for your target CF engine.
  • Record and port JVM options:
    • Heap and metaspace: -Xms, -Xmx, -XX:MaxMetaspaceSize
    • GC: G1GC recommended for most workloads.
    • TLS and Security: -Dhttps.protocols=TLSv1.2,TLSv1.3
    • File encoding and locale if needed: -Dfile.encoding=UTF-8
  • Keep a copy of current jvm.config and document changes.

5. Install the target ColdFusion engine

  • Adobe ColdFusion:
    • Install to a new directory/host; do not in‑place overwrite.
    • Apply latest updates/hotfixes.
    • Use wsconfig to connect IIS/Apache, or run behind a Reverse proxy.
  • Lucee:
    • Use the official installers, or run via Tomcat/Jetty.
    • Prefer CommandBox for lightweight, scripted instances.

Example: Apache httpd virtual host (HTTP proxy to Tomcat/CF)

<VirtualHost *:80>
ServerName app.example.com
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8500/
ProxyPassReverse / http://127.0.0.1:8500/

Security hardening

<Location “/CFIDE”>
Require all denied


6. Migrate administrator configuration and datasources

  • Prefer export/import tools over file copying:
    • Adobe CF:
      • cfsetup export myserver.json (from source)
      • cfsetup import myserver.json (to target)
      • CAR packages for selective settings
    • Lucee:
      • Use CFConfig (CommandBox) to export/import server and web context settings.
  • Datasources:
    • Recreate DSNs with updated JDBC drivers.
    • Validate connection strings, SSL parameters, and timezone options.
  • Mail server, mappings, caches, ORM, REST endpoints: import and validate.

Table: What to migrate and how

  • Administrator settings | Where | How
  • Datasources | CF Admin | cfsetup/CAR (Adobe), CFConfig (Lucee)
  • Mail server | CF Admin | cfsetup/CFConfig
  • Mappings/Custom tags | Application.cfc + CF Admin | Code + cfsetup/CFConfig
  • Scheduled tasks | CF Admin | Admin API export/import; avoid copying neo-cron.xml
  • Security/Sandbox | CF Admin | Reapply manually or via export tool

7. Move files, assets, and scheduled tasks

  • Webroot, custom tag paths, and libraries: copy to new instance while keeping permissions intact.
  • Scheduled tasks:
    • Export via Admin APIs where possible.
    • Recreate tasks with secure credentials; avoid plaintext passwords.
    • Test task execution windows and concurrency.

8. Update libraries and drivers

  • JDBC drivers:
    • Use vendor‑recommended drivers for your DB.
    • For MSSQL, prefer the latest mssql-jdbc with proper encryption settings.
  • PDF/CFDocument:
    • Update font libraries; package custom fonts to ensure consistent output.
  • Mail/TLS:
    • Ensure JDK has correct CA roots; configure SMTPS/TLSv1.2+.

9. Tune the web server connector or proxy

  • IIS:
    • Use Adobe’s wsconfig to generate the connector.
    • Confirm application pool identity, pipeline mode, and request filtering.
  • Apache httpd:
    • Choose HTTP proxy over AJP unless you properly secure AJP (secret/allowed IP).
  • Tomcat server.xml hardening:
See also  How to Ensure SEO Continuity After Migration

<Connector port=”8500″ protocol=”org.apache.coyote.http11.Http11NioProtocol”
maxThreads=”200″ connectionTimeout=”20000″
redirectPort=”8443″ URIEncoding=”UTF-8″
relaxQueryChars=”[,]”/>

10. Apply security hardening

  • Lock down CFIDE and admin endpoints; restrict by IP or remove from public hosts.
  • Use vendor lockdown tools/guides (Adobe Lockdown Tool; Lucee security guidelines).
  • Sandbox security or per‑app permissions where possible.
  • Secrets management: externalize credentials (env vars, vaults).
  • Enforce HTTPS, HSTS, secure cookies (httponly, secure, samesite).

11. Testing strategy (unit, Integration, Performance)

  • Unit/Integration tests with TestBox; mock external services.
  • Smoke tests for key URLs, logins, forms, file uploads, reporting.
  • Performance: JMeter/k6 for load; profile with FusionReactor/New Relic.
  • Regression checks for PDFs, Excel/CSV outputs, and encodings.

12. Cutover and rollback plan

  • Blue‑green Deployment:
    • Bring up the new stack in parallel.
    • Sync data and files; warm caches.
    • Flip DNS or load balancer to green; maintain a low DNS TTL.
  • Database migrations:
  • Rollback:
    • Preserve old environment until validation complete.
    • Revert DNS or LB; restore DB snapshot if schema changes were breaking.

13. Post‑Deployment monitoring and Optimization

  • JVM health: heap usage, GC times, thread counts.
  • App metrics: error rate, response times, queue depth, scheduled task success.
  • Logs:
    • ColdFusion logs (application.log, exception.log, scheduler.log).
    • Web Server access/error logs.
  • Iterate on JVM and CF settings based on data, not guesswork.

Risks, Common Issues, and How to Avoid Them

Compatibility breaks between versions/engines

  • Issue: Deprecated tags/functions or differences in default behaviors (e.g., implicit getters/setters, variable scoping, array/list functions).
  • Avoidance:
    • Run code analyzers; enable strict scoping (var/local).
    • Add this.sameformfieldsasarray = true (as needed) and test.
    • For Lucee migration, review Adobe‑only features (e.g., some admin APIs, cfclient) and find alternatives.

Encoding and locale pitfalls

  • Issue: Shift from system default encoding to UTF‑8 can change string/byte handling; PDF output differences.
  • Avoidance:
    • Set this.charset = “UTF-8”; ensure DB connection uses UTF‑8/collation; verify PDF fonts fully support characters.

Session and cookie behavior

  • Issue: Changes to default session cookies (httponly, samesite) can break legacy flows or third‑party embedded apps.
  • Avoidance:
    • Explicitly set cookie attributes and test SSO scenarios.
    • Consider external session stores in clustered environments.

Scheduled tasks migration

  • Issue: Copying neo-cron.xml between versions corrupts scheduler.
  • Avoidance:
    • Recreate tasks with Admin API or export/import tools; test with shorter intervals in staging.

JDBC driver and transaction changes

  • Issue: New drivers enforce encryption or change default autocommit/isolation.
  • Avoidance:
    • Review driver release notes; set encryption and truststore; set isolation explicitly in cftransaction if needed.

PDF/CFDocument changes

  • Issue: Font substitution, image DPI differences, and HTML/CSS rendering changes.
  • Avoidance:
    • Bundle fonts; standardize CSS; test critical PDFs with golden image comparisons.

Connector and AJP security

  • Issue: Unsecured AJP can expose your app.
  • Avoidance:
    • Prefer HTTP proxy; if using AJP, set secretRequired and restrict to localhost/VPC.

Licensing and feature availability

  • Issue: Differences between Adobe editions (Standard vs Enterprise) or Lucee extensions.
  • Avoidance:
    • Map features to licenses/extensions early; validate concurrency and cores.

Post-Migration Checklist

  • Administration and access

    • ColdFusion Administrator reachable only from secure networks/VPN.
    • CFIDE removed or heavily restricted from public sites.
  • Runtime compatibility

    • JVM version and options match the planned configuration.
    • cfpm/extension modules installed (ORM, Solr, PDFg if applicable).
  • Configuration validation

    • All DSNs test successfully with encrypted connections.
    • Mail server tests (TLS, auth) succeed; SPF/DKIM/DMARC unaffected.
    • Mappings, Custom tags, and per‑app settings (Application.cfc) verified.
  • Scheduled tasks

    • All tasks listed; next run times correct; logs show at least one successful execution.
  • Security and Compliance

    • TLS certificates installed and trusted; intermediate chains correct.
    • Cookies set with Secure and HttpOnly; consider SameSite=Lax/None as needed.
    • Log retention and rotation policies confirmed.
  • Functional smoke tests

    • Authentication/SSO flows.
    • File uploads/downloads; image manipulation; PDF generation.
    • Critical forms and workflows; APIs (REST/SOAP) with clients.
    • Edge cases with special characters and large payloads.
  • Performance and stability

    • Baseline response times and error rates compared to pre‑migration.
    • GC logs healthy; no thread pool starvation; 95th/99th percentile latencies acceptable.
  • Observability and alerts

    • Health endpoints monitored; alerts for error spikes, high CPU/memory, connector queue backlogs.
    • Dashboards updated to point to new hosts/containers.
  • Documentation and rollback

    • Runbook updated with new locations, versions, ports, and credentials policies.
    • Rollback plan verified and time‑boxed; decommission old stack only after sign‑off.
See also  How to Migrate ColdFusion Code to CFScript Syntax

Reference configuration snippets

Programmatically defining a datasource (Lucee and Adobe-compatible pattern)

component {
this.datasource = “MainDSN”; // define in Admin for simplicity
// Optionally define DSNs per environment
if (server.os.name CONTAINS “Windows”) {
this.datasource = “MainDSN_WIN”;
} else {
this.datasource = “MainDSN_LNX”;
}
}

JVM options (set in jvm.config or setenv.sh)

-Xms2g
-Xmx2g
-XX:+UseG1GC
-XX:MaxGCPauseMillis=200
-Dfile.encoding=UTF-8
-Dhttps.protocols=TLSv1.2,TLSv1.3
-Djava.security.egd=file:/dev/urandom

IIS connector commands (Adobe wsconfig)

  • Run wsconfig.exe as Administrator from cfusion/runtime/bin:

wsconfig.exe -help
wsconfig.exe -list
wsconfig.exe -add -site 1 -vdir cfapp -coldfusion -path “C:\ColdFusion2023\cfusion\runtime\bin”

(Choose parameters according to your IIS site and install path.)

Tomcat AJP hardening (if you must use AJP)

<Connector protocol=”AJP/1.3″ address=”127.0.0.1″ port=”8009″
secretRequired=”true” secret=”StrongRandomSecret”
allowedRequestAttributesPattern=”.*” />


Risks matrix and quick mitigations

  • Feature differences (Adobe vs Lucee) | Audit and replace Adobe‑specific tags; use community extensions
  • Charset/locale issues | Force UTF‑8 end‑to‑end; verify DB collation; test PDFs
  • TLS/mail failures | Update truststores; enforce TLSv1.2+; verify STARTTLS
  • Scheduler breakage | Recreate via API; do not copy neo-cron.xml
  • Connector errors 500/502 | Verify connector version; prefer HTTP proxy; review timeouts
  • Memory leaks/perf regressions | Use profilers; tune G1GC; check custom caches

Practical example: migrating settings as code

  • Adobe CF (cfsetup):

    • On source: cfsetup export cf-config.json
    • On target: cfsetup import cf-config.json
    • Review and sanitize secrets; store final in a secure vault.
  • Lucee (CommandBox CFConfig):

box install commandbox-cfconfig
cfconfig export from=/path/to/old/lucee to=lucee-config.json
cfconfig import to=/path/to/new/lucee from=lucee-config.json

This approach reduces manual errors and provides a versioned, reviewable configuration.


Performance tune-up quick wins

  • Enable compression at the web server (gzip/brotli) for text responses.
  • Cache heavy queries with cachedWithin, but invalidate explicitly on writes.
  • Use queryExecute with params to encourage proper JDBC typing.
  • Offload large file downloads/uploads through the web server where possible.
  • Profile cfdocument invocations; pre‑render HTML and minimize inline CSS.

FAQ

Do I need to upgrade the JDK when I upgrade ColdFusion?

Often yes. Each ColdFusion engine supports specific JDK majors. Running on an unsupported JDK can cause subtle classloader and TLS issues. Check the vendor support matrix and upgrade the JDK in tandem with CF, updating JVM options and truststores.

What is the safest way to migrate scheduled tasks?

Avoid copying scheduler configuration files (like neo-cron.xml). Use the Administrator APIs or export/import tools (cfsetup, CFConfig) to recreate tasks. After import, run each task manually in staging and verify logs, credentials, and time windows.

Can I run Adobe ColdFusion and Lucee side‑by‑side during migration?

Yes. Run them on different ports or hosts behind a load balancer or Reverse proxy. Route subsets of URLs or user traffic to Lucee for canary testing. Keep sessions and data stores compatible or isolate traffic during testing.

How should I handle CFAdmin settings across environments?

Treat settings as code. For Adobe, use cfsetup or CAR files; for Lucee, use CFConfig. Store sanitized exports in source control, inject secrets via environment variables or a vault, and apply during deployment in a predictable pipeline.

What’s the best rollback strategy if something goes wrong?

Keep the old stack running in a blue‑green model. Maintain a restorable DB snapshot if you perform schema changes. If validation fails, flip DNS or load balancer back to the old environment and open a post‑mortem to address gaps before retrying.

About the author

Aaron Longnion

Aaron Longnion

Hey there! I'm Aaron Longnion — an Internet technologist, web software engineer, and ColdFusion expert with more than 24 years of experience. Over the years, I've had the privilege of working with some of the most exciting and fast-growing companies out there, including lynda.com, HomeAway, landsofamerica.com (CoStar Group), and Adobe.com.

I'm a full-stack developer at heart, but what really drives me is designing and building internet architectures that are highly scalable, cost-effective, and fault-tolerant — solutions built to handle rapid growth and stay ahead of the curve.