Packaging & Deployment - ColdFusion Archives
Create, deploy, and manage CAR files for application deployment and migration
Overview
ColdFusion Archives (CAR files) provide a comprehensive packaging solution for deploying applications, migrating configurations between servers, and maintaining consistent environments. Archives bundle application code, settings, datasources, mappings, and other configurations into a single deployable unit that can be extracted on any ColdFusion server.
CAR files are essential for managing multi-server deployments, staging environments, disaster recovery, and maintaining configuration consistency across development, testing, and production environments.
What Gets Archived
ColdFusion Archives can include various server settings and application components.
Application Files
CFM/CFC templates, images, CSS, JavaScript, and other static assets within the selected directory structure.
Datasources
JDBC datasource configurations including connection strings, pooling settings, and authentication (passwords can be excluded for security).
Mappings
ColdFusion and custom tag path mappings that define logical paths to physical directories.
Mail Settings
SMTP server configurations including server addresses, ports, authentication, and default settings.
Scheduled Tasks
Automated task definitions including URLs, schedules, intervals, and execution parameters.
Event Gateways
Event gateway instances, configurations, and related CFC listeners for asynchronous processing.
Web Services
SOAP web service connections, WSDL URLs, and service mappings.
REST Services
RESTful web service configurations, endpoints, and authentication settings.
Document Settings
PDF generation settings, font configurations, and document service parameters.
Custom Settings
Application-specific settings, custom Java settings, and environment variables.
Creating Archives
Configure archive creation settings to bundle applications and configurations.
Archive Name
applicationname-environment-version.carmyapp-production-v2.3.1.carecommerce-staging-20251027.carArchive Description
- Include version numbers and release dates
- List major features or changes included
- Note any special deployment instructions
- Document dependencies or prerequisites
Application Root Directory
/var/www/myappC:\inetpub\wwwroot\ecommerceSelect Components to Archive
- Full Migration: Include all components for complete server migration
- Application Deployment: Include only application-specific settings
- Configuration Backup: Include settings but exclude application files
- Selective Sync: Include only changed components for updates
Include Password Information
Deploying Archives
Extract and deploy CAR files to configure target servers.
Select Archive File
Upload: Upload CAR file from local machine
- Verify archive integrity before deployment
- Review archive description to confirm correct version
- Test deployment on staging environment first
- Keep backup of current configuration before deploying
Deployment Directory
/var/www/production/myappC:\inetpub\wwwroot\live\ecommerceSelect Components to Deploy
Code Only: Deploy application files without changing settings
Settings Only: Deploy configurations without touching code
Selective: Deploy specific components as needed
- Production Update: Deploy code only, keep existing datasource configurations
- New Environment: Deploy all components for complete setup
- Configuration Sync: Deploy settings only to standardize environments
- Hotfix: Deploy application files only for quick patches
Overwrite Existing Settings
Skip Existing: Keep current settings, add only new ones
Merge: Combine archived and existing settings (where supported)
Archive Management Best Practices
Version Control
- Use semantic versioning for archive names (v2.3.1)
- Include date stamps for time-based tracking (YYYYMMDD)
- Tag archives with environment identifiers (dev, staging, prod)
- Maintain archive inventory with descriptions and deployment dates
- Keep archives for at least 3 previous versions for rollback capability
Security Considerations
- Never include passwords in archives (configure manually post-deployment)
- Encrypt CAR files when transferring over networks
- Store archives in secure, access-controlled locations
- Use separate archives for different environments
- Exclude sensitive files (.env, credentials, private keys)
- Review archive contents before distribution
- Implement access controls for archive creation and deployment
Storage and Retention
- Store archives outside webroot to prevent unauthorized downloads
- Use dedicated archive repository with backup
- Implement retention policy (e.g., keep 90 days of archives)
- Archive critical production deployments to long-term storage
- Document archive locations in disaster recovery plans
- Compress old archives to save storage space
Deployment Workflow
- 1. Create: Build archive from source environment (development)
- 2. Test: Deploy to staging environment and verify functionality
- 3. Backup: Create archive of current production configuration
- 4. Deploy: Extract archive to production environment
- 5. Configure: Manually set environment-specific settings (passwords, URLs)
- 6. Verify: Test critical functionality post-deployment
- 7. Monitor: Watch logs and metrics for issues
- 8. Document: Record deployment details and any issues
Archive Creation Example
Programmatic archive creation using CFML for automation:
<cfscript>
// Archive creation for deployment automation
archiveName = "myapp-production-v#application.version#.car";
archivePath = "/opt/archives/#archiveName#";
appRoot = expandPath("/");
// Create archive using admin API
adminAPI = createObject("component", "cfide.adminapi.extensions");
adminAPI.login("admin", "adminpassword");
archiveSettings = {
archiveName: archiveName,
description: "Production deployment v#application.version# - #dateFormat(now(), 'yyyy-mm-dd')#",
directory: appRoot,
includeDatasources: true,
includeMappings: true,
includeMailSettings: true,
includeScheduledTasks: true,
includePasswords: false, // Security: never include passwords
saveToPath: archivePath
};
// Create the archive
try {
adminAPI.createArchive(argumentCollection=archiveSettings);
writeOutput("Archive created successfully: #archiveName#");
// Log archive creation
writeLog(
file="deployment",
type="information",
text="Archive created: #archiveName# - Size: #numberFormat(getFileInfo(archivePath).size / 1024 / 1024, '0.00')# MB"
);
}
catch (any e) {
writeLog(
file="deployment",
type="error",
text="Archive creation failed: #e.message#"
);
rethrow;
}
</cfscript><!--- Archive creation for deployment automation --->
<cfset archiveName = "myapp-production-v#application.version#.car">
<cfset archivePath = "/opt/archives/#archiveName#">
<cfset appRoot = expandPath("/")>
<!--- Create archive using admin API --->
<cfset adminAPI = createObject("component", "cfide.adminapi.extensions")>
<cfset adminAPI.login("admin", "adminpassword")>
<cftry>
<cfset adminAPI.createArchive(
archiveName = archiveName,
description = "Production deployment v#application.version# - #dateFormat(now(), 'yyyy-mm-dd')#",
directory = appRoot,
includeDatasources = true,
includeMappings = true,
includeMailSettings = true,
includeScheduledTasks = true,
includePasswords = false,
saveToPath = archivePath
)>
<cfoutput>Archive created successfully: #archiveName#</cfoutput>
<!--- Log archive creation --->
<cflog
file="deployment"
type="information"
text="Archive created: #archiveName# - Size: #numberFormat(getFileInfo(archivePath).size / 1024 / 1024, '0.00')# MB">
<cfcatch type="any">
<cflog
file="deployment"
type="error"
text="Archive creation failed: #cfcatch.message#">
<cfrethrow>
</cfcatch>
</cftry>- Consistent archive creation process
- Integration with CI/CD pipelines
- Automated versioning and naming
- Audit trail through logging
Common Issues & Solutions
Archive Deployment Fails
- Verify ColdFusion has write permissions to target deployment directory
- Ensure deployment directory exists before extraction
- Check disk space availability on target server
- Verify archive file is not corrupted (check file size, integrity)
- Review ColdFusion logs for specific error messages
- Try extracting to different directory to isolate permission issues
Datasources Not Working After Deployment
- Manually configure datasource passwords (not included in archive for security)
- Update connection strings for target environment
- Verify database server is accessible from new environment
- Check JDBC driver is installed on target server
- Update host names, ports, and database names for environment
- Test datasource connection in administrator
Mappings Point to Wrong Directories
- Update mapping paths for target server directory structure
- Use relative paths instead of absolute paths where possible
- Create directory structure to match source environment
- Exclude mappings from archive and configure manually per environment
- Document mapping requirements in deployment guide
- Use environment variables for path configuration
Archive Too Large to Upload
- Transfer archive via FTP/SFTP instead of HTTP upload
- Increase maximum POST size in administrator settings
- Split archive into smaller components (code vs. settings)
- Exclude large static assets from archive (deploy separately)
- Use command-line tools for server-to-server transfer
- Compress archive or exclude unnecessary files