Import OneCX Data
To operate a local OneCX, some services require initial data, e.g., the theme, the admin workspace, permissions, etc.
The import-onecx.sh script is used to import data needed by the OneCX services. It can be run from the root directory of the onecx-local-env repository. Here the command for importing the data for the essential services:
./import-onecx.sh
Available Flags
The script accepts several optional flags to customize its behavior. Some flags can be combined. The flags are:
- -d
-
Specify a set of data to be imported (all, base) or a specific data type like workspace, theme etc.
-
base (Default).
-
all
-
one of [ bookmark, assignment, parameter, permission, mfe, ms, product, slot, tenant theme, welcome, workspace]
-
- -e
-
The edition of OneCX. This must match the edition that was used to start the environment. Supported editions are:
-
v2 (Default).
-
v1
-
- -h
-
Displays help information about the script and its available flags. If used then all other options are ignored.
- -s
-
Secure authentication enabled, default not enabled (value is inherited from start-onecx.sh)
Once Docker services have been started with the security option enabled, all subsequent actions require an authenticated user. For example, an import operation must then be started with the -s option to succeed.
- -t
-
Define the tenant for tenant-specific imports (e.g. workspace, theme). In consequence of using a tenant different than default the security option is set and an appropriate user is used to execute the import. The user is authorized, the tokens are getted and then the import is executed with the tokens as request header. Therefore the security option is enabled.
-
default (default)
-
t1
-
t2
-
- -v
-
Verbose: display details during import of objects
- -x
-
Skip checking running Docker services
When used, Docker does not check whether services require authentication. Please use the same security settings as when starting with start-onecx.sh.
Examples
Import ALL data
Import all available OneCX data as: * Non-tenant specific data * Tenant data for default tenant Before the import, a check is performed to ensure that all required services are already running. Any missing services are started.
./import-onecx.sh -d all
Import specific data, skip check
Only workspace data is imported. If the data are tenant-specific data then the default tenant is used (use flag -t for a different tenant) Running services are not checked beforehand. If a required service is not running, the import will fail.
./import-onecx.sh -d workspace -x
Import Tenant data
Import essential OneCX data as: * Non-tenant specific data * Tenant data for t1 tenant
To import tenant-specific data, services with secure authentication enabled must be running. Without the -x flag, Docker restarts the services with the security option enabled. A corresponding user exists for each tenant. The import is performed using this authorized user.
./import-onecx.sh -t t1
|
If you want only import tenant-specific data but do not working afterwards with secure authentication then execute the start-onecx.sh script without -s option again. This reset the security option on running services. |