CFConfig Documentation
  • Introduction
  • The Basics
    • About This Book
    • Authors
    • Overview
    • Getting Started Guide
    • Supported Engines
    • Config Items
  • Using the CLI
    • Installation
    • Usage
    • CommandBox Server Interceptors
      • Server Start
      • Server Stop
    • Command Overview
      • Export Settings
      • Import Settings
      • Transfer Settings
      • Diff Settings
      • Set/View Settings
      • Manage Datasources
      • Manage CF Mappings
      • Manage Caches
      • Manage Mail Servers
      • Manage Event Gateway Configuration
      • Manage Event Gateway Instances
      • Manage Lucee Loggers
      • Manage Scheduled Tasks
    • JSON File Storage
    • Env Var Overrides
  • Using the Services
    • Installation
    • Component Overview
    • API Overview
Powered by GitBook
On this page
  • IncludeList and excludeList
  • Append flag

Was this helpful?

Edit on GitHub
Export as PDF
  1. Using the CLI
  2. Command Overview

Import Settings

Import configuration to a server. If you don't specify a to, we look for a CommandBox server using the current working directory. Only rely on this if you have a single CommandBox server running in the current directory.

cfconfig import myConfig.json
cfconfig import to=serverName from=myConfig.json
cfconfig import to=/path/to/server/home from=myConfig.json

All the same rules for engine format and version apply.

cfconfig import from=/path/to/.CFConfig.json to=/path/to/server/home toFormat=luceeServer@5.1

The version number can be left off toFormat and fromFormat when reading or writing to a CFConfig JSON file or a CommandBox server since we already know the version. If you don't specify a Lucee web or Server context, we default to server. Use a format of luceeWeb to switch.

cfconfig import from=myConfig.json toFormat=luceeWeb

IncludeList and excludeList

You can customize what config settings are transferred with the includeList and excludeList params. If at least one include pattern is provided, only matching settings will be included. Nested keys such as datasources.myDSN or mailservers[1] can be used. You may also use basic wildcards in your pattern. A single * will match any number of chars inside a key name. A double ** will match any number of nested keys.

# Include all settings starting with "event"
cfconfig import from=.CFConfig.json includeList=event*
# Exclude all keys called "password" regardless of what struct they are in
cfconfig import from=.CFConfig.json excludeList=**.password

Append flag

Use the append parameter to merge incoming data with any data already present. For example, if a server already has one datasource defined, and you import a JSON file with 2 more unique datasources, the --append flag will not remove the pre-existing one.

cfconfig import from=.CFConfig.json includeList=datasources --append
PreviousExport SettingsNextTransfer Settings

Last updated 9 months ago

Was this helpful?