LogoLogo
StackState.comDownloadSupportExplore playground
StackState v5.1
StackState v5.1
  • Welcome to the StackState docs!
  • StackState self-hosted v5.1 docs
  • Getting Started
  • 🚀Setup
    • Install StackState
      • Requirements
      • Kubernetes / OpenShift
        • Kubernetes install
        • OpenShift install
        • Required Permissions
        • Non-high availability setup
        • Override default configuration
        • Configure storage
        • Configure Ingress
        • Install from custom image registry
        • Migrate from Linux install
      • Linux
        • Before you install
        • Download
        • Install StackState
        • Install with production configuration
        • Install with development configuration
        • Install with POC configuration
        • Set up a reverse proxy
        • Set up TLS without reverse proxy
      • Initial run guide
      • Troubleshooting
    • Upgrade StackState
      • Steps to upgrade
      • Version specific upgrade instructions
      • StackPack versions
      • StackState release notes
    • StackState Agent
      • About StackState Agent V3
      • Docker
      • Kubernetes / OpenShift
      • Linux
      • Windows
      • Advanced Agent configuration
      • Use an HTTP/HTTPS proxy
      • Agent V1 (legacy)
      • Migrate Agent V1 to Agent V2
        • Linux
        • Docker
    • StackState CLI
      • CLI: sts
      • CLI: stac (deprecated)
      • Comparison between CLIs
    • Data management
      • Backup and Restore
        • Kubernetes backup
        • Linux backup
        • Configuration backup
      • Data retention
      • Clear stored data
  • 👤Use
    • Concepts
      • The 4T data model
      • Components
      • Relations
      • Health state
      • Layers, Domains and Environments
      • Perspectives
      • Anomaly detection
      • StackState architecture
    • StackState UI
      • Explore mode
      • Filters
      • Views
        • About views
        • Configure the view health
        • Create and edit views
        • Visualization settings
      • Perspectives
        • Topology Perspective
        • Events Perspective
        • Traces Perspective
        • Metrics Perspective
      • Timeline and time travel
      • Analytics
      • Keyboard shortcuts
    • Checks and monitors
      • Checks
      • Add a health check
      • Anomaly health checks
      • Monitors
      • Manage monitors
    • Problem analysis
      • About problems
      • Problem lifecycle
      • Investigate a problem
      • Problem notifications
    • Metrics
      • Telemetry streams
      • Golden signals
      • Top metrics
      • Add a telemetry stream
      • Browse telemetry
      • Set telemetry stream priority
    • Events
      • About events
      • Event notifications
      • Manage event handlers
    • Glossary
  • 🧩StackPacks
    • About StackPacks
    • Add-ons
      • Autonomous Anomaly Detector
      • Health Forecast
    • Integrations
      • About integrations
      • 💠StackState Agent V2
      • 💠AWS
        • AWS
        • AWS ECS
        • AWS X-ray
        • StackState/Agent IAM role: EC2
        • StackState/Agent IAM role: EKS
        • Policies for AWS
        • AWS (legacy)
        • Migrate AWS (legacy) to AWS
      • 💠Dynatrace
      • 💠Kubernetes
      • 💠OpenShift
      • 💠OpenTelemetry
        • About instrumentations
        • AWS NodeJS Instrumentation
        • Manual Instrumentation
          • Prerequisites
          • Tracer and span mappings
          • Relations between components
          • Span health state
          • Merging components
          • Code examples
      • 💠ServiceNow
      • 💠Slack
      • 💠Splunk
        • Splunk
        • Splunk Events
        • Splunk Health
        • Splunk Metrics
        • Splunk Topology
      • 💠VMWare vSphere
      • Apache Tomcat
      • Azure
      • Cloudera
      • Custom Synchronization
      • DotNet APM
      • Elasticsearch
      • Humio
      • Java APM
      • JMX
      • Logz.io
      • MySQL
      • Nagios
      • OpenMetrics
      • PostgreSQL
      • Prometheus
      • SAP
      • SCOM
      • SolarWinds
      • Static Health
      • Static Topology
      • Traefik
      • WMI
      • Zabbix
    • Develop your own StackPacks
  • 🔧Configure
    • Topology
      • Component actions
      • Identifiers
      • Topology naming guide
      • Topology sources
      • Create a topology manually
      • Configure topology synchronizations
      • Enable email event notifications
      • Send topology data over HTTP
      • Set the topology filtering limit
      • Use a proxy for event handlers
      • Use tags
      • Tune topology synchronization
      • Debug topology synchronization
    • Telemetry
      • Add telemetry during topology synchronization
      • Data sources
        • Elasticsearch
        • Prometheus mirror
      • Send events over HTTP
      • Send metrics data over HTTP
      • Set the default telemetry interval
      • Debug telemetry synchronization
    • Traces
      • Set up traces
      • Advanced configuration for traces
    • Health
      • Health synchronization
      • Send health data over HTTP
        • Send health data
        • Repeat Snapshots JSON
        • Repeat States JSON
        • Transactional Increments JSON
      • Debug health synchronization
    • Anomaly Detection
      • Export anomaly feedback
      • Scale the AAD up and down
      • The AAD status UI
    • Security
      • Authentication
        • Authentication options
        • File based
        • LDAP
        • Open ID Connect (OIDC)
        • KeyCloak
        • Service tokens
      • RBAC
        • Role-based Access Control
        • Permissions
        • Roles
        • Scopes
        • Subjects
      • Secrets management
      • Self-signed certificates
      • Set up a security backend for Linux
      • Set up a security backend for Windows
    • Logging
      • Kubernetes logs
      • Linux logs
      • Enable logging for functions
  • 📖Develop
    • Developer guides
      • Agent checks
        • About Agent checks
        • Agent check API
        • Agent check state
        • How to develop Agent checks
        • Connect an Agent check to StackState
      • Custom functions and scripts
        • StackState functions
        • Check functions
        • Component actions
        • Event handler functions
        • ID extractor functions
        • Mapping functions
        • Monitor functions
        • Propagation functions
        • Template functions
        • View health state configuration functions
      • Custom Synchronization StackPack
        • About the Custom Synchronization StackPack
        • How to customize elements created by the Custom Synchronization StackPack
        • How to configure a custom synchronization
      • Integrate external services
      • Mirroring Telemetry
      • Monitors
        • Create monitors
        • Monitor STJ file format
      • StackPack development
        • How to create a StackPack
        • Packaging
        • How to get a template file
        • How to make a multi-instance StackPack
        • Prepare a multi-instance provisioning script
        • Upload a StackPack file
        • Prepare a shared template
        • Customize a StackPack
        • Prepare instance template files
        • Prepare a StackPack provisioning script
        • Resources in a StackPack
        • StackState Common Layer
      • Synchronizations and templated files
    • Reference
      • StackState OpenAPI docs
      • StackState Template JSON (STJ)
        • Using STJ
        • Template functions
      • StackState Markup Language (STML)
        • Using STML
        • STML Tags
      • StackState Query Language (STQL)
      • StackState Scripting Language (STSL)
        • Scripting in StackState
        • Script result: Async
        • Script result: Streaming
        • Time in scripts
        • Script APIs
          • Async - script API
          • Component - script API
          • HTTP - script API
          • Prediction - script API
          • StackPack - script API
          • Telemetry - script API
          • Time - script API
          • Topology - script API
          • UI - script API
          • View - script API
    • Tutorials
      • Create a simple StackPack
      • Push data to StackState from an external system
      • Send events to StackState from an external system
      • Set up a mirror to pull telemetry data from an external system
Powered by GitBook
LogoLogo

Legal notices

  • Privacy
  • Cookies
  • Responsible disclosure
  • SOC 2/SOC 3
On this page
  • Overview
  • Export configuration
  • StackState CLI
  • curl
  • StackState UI
  • Import configuration
  • StackState CLI
  • curl
  • StackState UI
  • Advanced import/export
  • Individual configuration items
  • Idempotent import/export
  • Configuration Export Versioning
  • Why versioning?
  • Supported versions
  • Available versions
  1. Setup
  2. Data management
  3. Backup and Restore

Configuration backup

StackState Self-hosted v5.1.x

PreviousLinux backupNextData retention

Last updated 2 years ago

Overview

StackState configuration can be exported and imported. The import/export functionality can be used to automate the installation process or for backup purposes. An export and import can be made in the settings page of StackState's user interface by using the buttons 'Export Model' and 'Import Model'.

Export configuration

An export of the StackState configuration can be obtained from the StackState UI, the or using curl commands.

StackState CLI

Note that the of configuration items installed by a StackPack configuration won't be included in the export.

To export configuration using the sts CLI, run the command:

# Output in terminal window
sts settings describe

# Export to file
sts settings describe --file <PATH_TO_FILE.stj>

From StackState v5.0, the old sts CLI has been renamed to stac and there is a new sts CLI. The command(s) provided here are for use with the new sts CLI.

➡️

To export configuration using the stac CLI (deprecated), run the command:

# Output in terminal window
stac graph export

# Export to file
stac graph export > export.stj

⚠️ From StackState v5.0, the old sts CLI is called stac. The old CLI is now deprecated.

The new sts CLI replaces the stac CLI. It's advised to install the new sts CLI and upgrade any installed instance of the old sts CLI to stac. For details see:

curl

To export configuration using curl, follow the steps below (with or without authentication):

You can configure StackState server to authenticate users when they access the application. To do this, an export curl script must first obtain a token before making the export request. This isn't necessary when using the StackState CLI as authentication details are configured during installation.

Here is a sample sequence of curl commands to achieve this. The <api-token> used for authorization is available on the CLI page in the StackState UI main menu:

# Obtain session from cookie AkkaHttpPac4jSession
# Obtain CSRF token from cookie pac4jCsrfToken
curl --fail -v \
  -H "Authorization: ApiToken <api-token>" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  "http://<HOST>:7070/loginCallback"

# Do actual request
export SESSION="<MY_SESSION>"; export CSRF_TOKEN="<MY_CSRF_TOKEN>"; \
  curl -v -X POST \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -d '{}' \
  -H Cookie:AkkaHttpPac4jSession=$SESSION \
  -H X-Sts-Token:$CSRF_TOKEN \
  "http://<HOST>:7070/api/export?timeoutSeconds=300" > export.stj
curl -X POST -H 'Content-Type: application/json;charset=UTF-8' \
  -d '{}' \
  "http://<host>:7070/api/export?timeoutSeconds=300" > export.stj

StackState UI

To export configuration from the StackState UI:

  1. Go to Settings > Import/Export > Export Settings

  2. Click the button STS-EXPORT-ALL.

Import configuration

StackState CLI

  • Import is intended to be a one-off action - importing multiple times might result in duplicate configuration entries. This behavior applies to importing nodes without any identifier.

To import StackState configuration using the sts CLI, follow the steps below.

sts settings apply --file <PATH_TO_FILE.stj>

From StackState v5.0, the old sts CLI has been renamed to stac and there is a new sts CLI. The command(s) provided here are for use with the new sts CLI.

To import StackState configuration using the stac CLI (deprecated), follow the steps below.

stac graph import < <PATH_TO_FILE.stj>

⚠️ From StackState v5.0, the old sts CLI is called stac. The old CLI is now deprecated.

The new sts CLI replaces the stac CLI. It's advised to install the new sts CLI and upgrade any installed instance of the old sts CLI to stac. For details see:

curl

  • Import is intended to be a one-off action - importing multiple times might result in duplicate configuration entries. This behavior applies to importing nodes without any identifier.

To import StackState configuration using curl with authentication, follow the steps below.

The <api-token> can be found on the CLI page in the StackState UI main menu.


# Obtain session from cookie AkkaHttpPac4jSession
# Obtain CSRF token from cookie pac4jCsrfToken
curl --fail -v \
  -H "Authorization: ApiToken <api-token>" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  "http://<host>:7070/loginCallback"

# Do actual request
export SESSION="<MY_SESSION>"; export CSRF_TOKEN="<MY_CSRF_TOKEN>"; \
  curl -X POST -d @export.stj \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H Cookie:AkkaHttpPac4jSession=$SESSION \
  -H X-Sts-Token:$CSRF_TOKEN "http://<HOST>:7070/api/import?timeoutSeconds=15"

To import StackState configuration using curl without authentication, follow the steps below.


## Import without authentication
curl -X POST -d @./export.stj \
  -H 'Content-Type: application/json;charset=UTF-8' \
  "http://<host>:7070/api/import?timeoutSeconds=15"
  

StackState UI

  • Import is intended to be a one-off action - importing multiple times might result in duplicate configuration entries. This behavior applies to importing nodes without any identifier.

To import StackState configuration in the StackState UI:

  1. Go to Settings > Import/Export > Import Settings.

  2. Choose the *.stj file that you want to import configuration from.

  3. Click the button START IMPORT.

Advanced import/export

Individual configuration items

It's possible to export and import individual configuration items through the StackState user interface. For example, to export or export a component type:

  1. Go to the Settings page and click Component Types.

  2. To export an individual component type, click Export as config.

  3. To import a configuration item, click Import Model.

Idempotent import/export

There is a way to use identifiers and namespaces that come with them to perform a configuration update of the specific sets of nodes idempotently. This approach doesn't lead to duplicates, but checks for the changes within a specified namespace and applies them to existing nodes, including removing nodes, as well as allow for creating the new ones.

Node identifiers are specified in a following pattern: urn:stackpack:{stackpack_name}:{type_name}:{object_name}. The namespace effectively used by this process is urn:stackpack:{stackpack_name}:. If every configuration node has an identifier and they're all in the same namespace, then you can perform an idempotent update using following STS CLI commands:

export

sts settings describe --namespace urn:stackpack:{stackpack_name}:

From StackState v5.0, the old sts CLI has been renamed to stac and there is a new sts CLI. The command(s) provided here are for use with the new sts CLI.

stac graph export --namespace urn:stackpack:{stackpack_name}:

⚠️ From StackState v5.0, the old sts CLI is called stac. The old CLI is now deprecated.

The new sts CLI replaces the stac CLI. It's advised to install the new sts CLI and upgrade any installed instance of the old sts CLI to stac. For details see:

import

curl -XPOST http://yourInstance/api/import?namespace=urn:stackpack:{stackpack_name} --data @./filename -H 'Content-Type: application/json'

Configuration Export Versioning

Why versioning?

As StackState evolves, versioning of the exported Node elements is necessary. The export conf contains metadata stating the Node version (_version), which is useful to allow an automatic upgrade to a more recent version of StackState and ensure compatibility.

{
  "_version": "1.0.0",
  "timestamp": "2018-12-06T12:30:44.148Z[Etc/UTC]",
  "nodes": [
    {
      "_type": "CheckFunction",
      "name": "Metric fixed run state",
      "returnTypes": [
        "RUN_STATE"
      ],
      "description": "This check will always return the run state that is provided when a metric has been received.",
      "id": -196,
      "script": "return metricFixedRunState;",
      "parameters": [
        {
          "_type": "Parameter",
          "name": "metrics",
          "system": false,
          "id": -194,
          "multiple": false,
          "type": "METRIC_STREAM",
          "required": true
        },
        {
          "_type": "Parameter",
          "name": "metricFixedRunState",
          "system": false,
          "id": -195,
          "multiple": false,
          "type": "RUN_STATE_VALUE",
          "required": true
        }
      ]
    }
  ]
}

Supported versions

For example:

Configuration export version 1.0.0 was introduced in StackState version 1.14.0 Later configuration export version 1.1.0 was introduced in StackState version 1.14.1 Later configuration export version 2.0.0 was introduced in StackState version 1.15.0

This means that Nodes with Configuration version 1.0.0 will work on both StackState 1.14.0 and 1.14.1 but not in 1.15.0 as a major configuration export version (2.0.0) was introduced. It also means that configuration export version 1.1.0 can only be used from StackState version 1.14.1 but not before as in 1.14.0

Available versions

The table below displays configuration export versions and on which StackState versions they were introduced.

Configuration Export version
Introduced on StackState version

1.0.0

1.14.0

Note that the of configuration items installed by a StackPack configuration won't be included in the export.

Note that the of configuration items installed by a StackPack configuration won't be included in the export.

Note that the of configuration items installed by a StackPack won't be included in configuration export files - all configuration items will be unlocked after import.

Before import, clear the StackState configuration by following the instructions at .

➡️

Before import, clear the StackState configuration by following the instructions at .

Note that the of configuration items installed by a StackPack won't be included in configuration export files - all configuration items will be unlocked after import.

Before import, clear the StackState configuration by following the instructions at .

Before import, clear the StackState configuration by following the instructions at .

Note that the of configuration items installed by a StackPack won't be included in configuration export files - all configuration items will be unlocked after import.

Before import, clear the StackState configuration by following the instructions at .

➡️

A configuration export is supported by versions of StackState that are equal or higher than the export's version and with the same major version (see ). The first configuration export version is 1.0.0, and effectively any Node payload with a version below or missing the version field (_version) will be interpreted and auto-upgraded to version 1.0.0.

🚀
clear stored data
clear stored data
Comparison between the CLIs
clear stored data
clear stored data
clear stored data
Comparison between the CLIs
semver
StackState CLI
Comparison between the CLIs
lock status
lock status
lock status
lock status
lock status
Check which version of the sts CLI you are running
Which version of the sts CLI am I running?
Check which version of the sts CLI you are running
Which version of the sts CLI am I running?
lock status
Check which version of the sts CLI you are running
Which version of the sts CLI am I running?
Install the new sts CLI and upgrade the old sts CLI to stac
Install the new sts CLI and upgrade the old sts CLI to stac
Install the new sts CLI and upgrade the old sts CLI to stac
Export configuration from the StackState UI
Import configuration from the StackState UI