//Cloudogu EcoSystem Docs

Exclude data from the migration

It is possible to exclude several types of data from the migration: whole dogus, files within dogus, and configuration values.

To use one or several of these possibilities, the CES-importer needs to be configured on the target instance. To do that, edit the CES-Component custom resource ("Component-CR") of the CES-Importer. This is possible by following these steps:

  • Edit the “Component-CR” of the CES-Importer:

    kubectl edit component ces-importer -n ecosystem
  • Enter the desired options (see the following sections of this document) in the valuesYamlOverwrite field
  • Example:

    apiVersion: k8s.cloudogu.com/v1
    kind: Component
    metadata:
    name: ces-importer
    namespace: ecosystem
    spec:
    name: ces-importer
    namespace: k8s
    version: 1.0.0
    valuesYamlOverwrite: |
      config:
        job:
          excludedGlobalConfiguration:
          - "default_dogu"
          excludedDoguConfigurations:
          - dogu: "postfix"
            keys:
            - "relayhost"
          exclude:
          - dogu: "official/jenkins"
            pattern: 
              - "subdir/*.groovy"
              - "*.tmp"
          - dogu: "official/nexus"
            pattern: 
              - "/tmp/"
  • Save the changes to the component-CR
  • Restart the CES-Importer:

    kubectl rollout restart deployment/ces-importer -n ecosystem

Dogus

To exclude whole dogus from the import, add the names of these dogus as a list under config/job/excludedDogus. It is not necessary to specify the namespace of the dogu. For example, jenkins can be used instead of official/jenkins.

Example

To exclude the jenkins and the redmine dogu from the import, use the following configuration:

...
  valuesYamlOverwrite: |
    config:
      job:
        excludedDogus:
        - "jenkins"
        - "redmine"
...

Files

In certain constellations, it may make sense to exclude manually created files from the migration, as they are unnecessary for CES-MN instances. This can be, for example, self-created scripts or other data in the volumes of the Dogus that should not be migrated.

For each dogu, files that are not to be migrated can be specified as patterns.

Note: Multiple exclude patterns can be specified for each dogu. The extended Dogu name with the namespace must be specified. For example official/jenkins, or official/nexus.

Exclude pattern

The pattern for excluding files can contain wildcards in order to be used as flexibly as possible: The following examples show the various possibilities:

Exclude a single directory
/tmp/

Excludes the directory /tmp/. All files and subdirectories in /tmp/ are not migrated.

Exclude all files with a specific file extension
*.log

Excludes all files with the extension .log, regardless of the directory in which they are located.

Exclude a specific file in a directory
/logs/error.log

Excludes only the file error.log in the directory logs, but not files with the same name in other directories.

Exclusion based on a partial path
**/node_modules/

Excludes every node_modules directory - recursively and regardless of how deep it is in the path.

Example

To exclude all files with the extension .tmp and all files within the directory subdir that have the ending .groovy for the jenkins dou, as well as the directory /tmp within the nexus dogu, the configuration would look like this:

...
  valuesYamlOverwrite: |
    config:
      job:
        exclude:
        - dogu: "official/jenkins"
          pattern: 
            - "subdir/*.groovy"
            - "*.tmp"
        - dogu: "official/nexus"
          pattern: 
            - "/tmp/"
...

Configurations

Configuration values can also be excluded from the import. This can be a good idea for the relayhost value of the postfix dogu. Excluding configuration values can lead to an unstable or inconsistent state of the target system and is done at one's own risk.

It is possible to exclude global as well as dogu-specific configuration values. By default, the values for fqdn, alternativeFQDNs, maintenance, as well as configuration starting with proxy/, k8s/ oder certificate/ are excluded from the import. Any custom exclusions are added to this list.

Example

In order to not overwrite the global configuration default_dogu as well as the postfix-specific relayhost on the importing system with the values from the exporting system, use the following configuration:

...
  valuesYamlOverwrite: |
    config:
      job:
        excludedGlobalConfigurationKeys:
        - "default_dogu"
        excludedDoguConfigurations:
        - dogu: "postfix"
          keys:
          - "relayhost"
...