Backing up and Restoring Sisense
  • 03 Nov 2022
  • 8 Minutes to read
  • Dark
    Light

Backing up and Restoring Sisense

  • Dark
    Light

You should backup Sisense as part of regular maintenance or before making significant changes to your deployment.
You can restore Sisense using backup files from the previous three major releases. For instance, L2021.7 can be restored with backup files from L2021.5, L2021.3, and L2021.1.

Accessing the Sisense CLI

To create a backup file, and to restore it later, you need to access the Sisense CLI that was installed with Sisense.
To access the Sisense CLI: see "Accessing the Sisense CLI" in Using Sisense CLI Commands.

Backing Up Sisense

To back up your Sisense deployment, you create a .tar file that stores an archive of your Sisense state. You can use the .tar file to restore your Sisense information.

Notes:

To minimize production-level impact and allow compute capacity for the backup operation, Sisense recommends backing up the system:

  • During low usage periods and without running any builds
  • Before each software update

Downgrade and rollback are only supported by restoring to a specific backed up version.

Backup Commands

Sisense supports several system backup commands and sub-commands.
To run each backup command:

  1. Log in to the Sisense CLI with the SSH protocol and the user account that was used to install Sisense.
  2. Navigate to the home folder where Sisense was installed.
  3. Run the relevant backup command.
    An assets backup archive is created in the following directory:
/opt/sisense/storage/system_backups/

This directory is accessible in single node deployments. For multi-node, use the management pod to access this directory.

System Command 

Sub-command

Description

Version

si system backup

Use this command to back up the system assets without the ElastiCubes. See Sisense Assets for list of file paths.

8.0.2


-include-farm true

Use this command to add ElastiCubes to a backup archive. The ElastiCube(s) data folder(s) includes the files in the data folders containing your raw data.The size of these data files can be very large so make sure you have enough space for the files and the available time to complete the backup.

8.0.2


-include-extra-paths true

If extra folders need to be backed up, paths to folders can be added to the ExtraBackupPaths field in Configuration > Management. Paths should be comma-separated. The default path is: "/opt/sisense/storage/build-plugins

8.2.1


-include-extra-paths yes -extra-paths path,path2,path3

Use this command to enter the path manually with the command line.

8.2.1


-to-s3 true

An AWS S3 bucket must be configured to use this backup command, see AWS S3 bucket creation and connection. Be sure that you disable "Block all public access" for the new bucket. After you set up the bucket, see the procedure to configure AWS S3 bucket access.

2021.7


-exclude-paths true -paths-to-exclude "/opt/sisense/storage/connectors,/opt/sisense/storage/datasets"

Use this command for excluding paths that are included in the default backup command. See Sisense Assets for list of file paths. Multiple paths must be comma separated and wrapped in quotation marks

(“XXX,YYY”)

2021.11

si system backup-cancel

Cancels currently running backup. May return false positive (report success, while backup completes) if issued on last stage of backup process

2021.12

To configure AWS S3 bucket access:
After you setup the AWS S3 bucket, complete the following steps on your virtual machine:

1. Run the following command to add the Sisense namespace details:

". add_completion-ns-sisense.sh <username>@sisense.com <password>"

2. Use the following CLI commands to set the S3BackupBucket name, access key, and secret key credentials.

si config set -key management.S3BackupBucket -new-value <BucketName>
si config set -key management.AWSAccessKey -new-value <AccessKey>
si config set -key management.AWSSecretKey -new-value <SecretKey>

Scheduled Backup Commands

Sisense recommends that you run scheduled backups during low-usage periods.

System Command

Sub-command

Description

Version

si schedulers backup create

Use this command to create a scheduled backup plan. All additional backup flags are supported. See Backup Command Example (below).

2021.7


-cron-expression "* * * * *"

See cron syntax in the image below.

2021.7


-retention [1-20]

Use this command to schedule backup with retention; retention must be between 1 and 20. Mandatory field

2021.7

To set a backup schedule for Sisense:
Enter the following command to set a schedule to back up the Sisense system assets:

si schedulers backup create -cron-expression "0 */* * * *"  -retention <1-20>

Cron expression_6.png

The retention flag number determines the number of backups that are kept in the systm_backups directory. The maximum number for this flag is 20.

Note:

Make sure there is enough drive space available for all backup copies that are to be retained.

Scheduled backup example:

si schedulers backup create -cron-expression "0 23 * * 6"  -retention 2

A backup starts at 23:00 every Sunday, and the system retains two backup copies.

Backup to External Resources

By default, Sisense stores backups on your shared storage.

You can save backups to external resources by downloading and modifying the Sisense script as described below.

To save a backup to an external source:

wget https://data.sisense.com/linux/scripts/backup.sh chmod a+x backup.sh/bin/bash ~/backup.sh <namespace> <user> <password>

The script saves a backup by default in: targetDir=~/backup/

To schedule a task to save a backup to an external source:

  1. In Sisense’s primary server, create a CronJob to pull your backup tarball from the shared storage.
  2. Download the following script:
wget https://data.sisense.com/linux/scripts/backup.sh chmod a+x backup.sh
  1. Open your CronJob with the following command:
Crontab -e
  1. Add a line to schedule a new CRON job. The following example is a line that schedules a daily pull at 2AM.
0 2 * * * /bin/bash ~/backup.sh <namespace> <user> <password>

The script saves a backup by default in: targetDir=~/backup/
You can change this value to store additional copies of sources external from your shared storage.

Backup Command Examples

The following backup command examples are provided for your reference:

What do you want to do?CommandString
Create a Sisense backup archiveEnter the following command to create a tarball backup file for the Sisense system assets.
si system backup
Include ElastiCubes in a Sisense backup archiveEnter the following command to create a tarball backup file for the Sisense system assets and ElatiCubes.


si system backup -include- farm true


Add extra folders to the Sisense backup archiveEnter the following command to add extra folders for data that you would like to add to the backup archive, in addition to the standard asset set. Multiple paths must be comma separated.
si system backup -include-extra-paths true -extra-paths “/opt/sisense/storage/data,/opt/sisense/storage/plugins-backup”

Command for backing up farms, and extra paths:
si system backup -include-farm true -include-extra-paths true -extra-paths “/opt/sisense/storage/data,/opt/sisense/storage/plugins-backup”
Schedule a task to save a backupCommand for scheduling a backup to s3 every day at 04:00, with farms and extra paths, and retention of 10 backup copies.
si schedulers create -cron-expression "0 4 * * *" -retention 10 -include-farm true -include-extra-paths true -extra-paths “/opt/sisense/storage/folder1,/opt/sisense/storage/folder2” -to-s3 true
Exclude folders from the Sisense backup archiveEnter the command to back up to s3, excluding connector paths, which excludes assets that are included by default in the backup command, see the Sisense Assets section. Multiple paths must be comma separated.
si system backup -exclude-paths true -paths-to-exclude “/opt/sisense/storage/connectors” -to-s3 true
Backup Sisense to an AWS S3 bucketTo use this AWS S3 backup option you must have: a) Defined an s3 bucket, see [AWS S3 bucket creation and connection](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html), and b) Configured Sisense to [store and build your ElastiCubes on S3](https://documentation.sisense.com/l2022-11/docs/new-backing-up-and-restoring-sisense). If you have configured AWS for Sisense, you can back up Sisense on S3 instead of shared storage.
si system backup -to-s3 true

Restoring Sisense

You can recover Sisense and your data if you have created a backup file. It might be necessary to restore this information if you experience problems in your Sisense Linux deployment due to data corruption or a storage failure.

To run each restore command:

Log in to the Sisense CLI with the SSH protocol and the user account that was used to install Sisense.

System CommandSub-commandDescriptionVersion
si system restore
  L8.2.1
 
si system restore
-name sisense_assets_collector_YYYY-MM-DD_HH_mm
Use this command to restore from a file. This command will not include extra paths.L8.2.1
 
-include-extra-paths true -name 
sisense_assets_collectore_yyyy_mm_dd_hh_mm.tar.gx 
Use this command to restore if extra paths are added during backup and it is necessary to restore those paths. The restore commands are for restoring paths that were included in the backup command and are in the current ExtraBackupPaths field in Configuration>Management.L8.2.1
 
-include-extra-paths true 
-extra-paths path,path2,path3 
-name sisense_assets_collectore_yyyy_mm_dd_hh_mm 
Use this command to restore paths that were included in the backup command and specified by user in the command lineL8.2.1
 
-from-s3 true 
-name sisense_assets_collectore_yyyy_mm_dd_hh_mm.tar.gx
Use this command to restore from S3. The backup file name should be taken from S3.L2021.7

Restore Command Example

The following restore examples are provided for your reference:

What do you want to do?CommandString
Restore a Sisense backupRestore your Sisense backup tarball and then manually restore the SSL certificates and private keys
si system restore -name /opt/sisense/storage/system_backups/ sisense_assets _collector_some_date.tar.gz -include-farm yes/no
 Restoring this s3 backup
si system restore -from-s3 true -name sisense_assets_collector_2021-08-23_11_46_27.tar.gz

Note: The restore command with excluded paths is identical to restoring a regular backup.
Restore a Sisense instance from backups on external resourcesCopy the backup file to the shared storage
kubectl -n sisense cp sisense_assets_collector_some_date.tar.gz$(kubectl -n sisense get pods -l app="management" -o custom- columns=":.metadata.name"):/opt/sisense/storage/system_backups//opt/sisense/storage/system_backups/sisense_assets_collector_some_date.tar.gz
 Command for restoring backed up farms and extra folders:
si system restore -include-farm true -include-extra-paths true 
-extra-paths /opt/sisense/storage/data , /opt/sisense/storage/plugins-backup 
-name sisense_assets_collector_2020-07-21_09_19_06

Sisense Assets

The following Sisense assets are included in the backup .tar file when the si system backup command is used.

AssetLocationIntroduced in Version
Data stored in MongoDB
mongodump /mongorestoreInitially implemented
Sisense plugins
/opt/sisense/storage/pluginsInitially implemented
Zookeeper settings for maintaining configuration informationImport/Export Zookeeper settingsInitially implemented
Farms
/opt/sisense/storage/farmsInitially implemented
Branded content saved in the Sisense branding directory, see White Labeling Sisense in Linux
/opt/sisense/storage/brandingInitially implemented
Datasets
/opt/sisense/storage/datasetsL8.0.5
Data source connectors
(see Linux Connectors for a list supported in Linux)
/opt/sisense/storage/connectorsL8.0.5
Kubernetes cronjob automatic tasks, including ElastiCube builds, scheduled to run at fixed times, dates, or intervals
Import/Export Kubernetes cronjobsL8.2.1
The static data sources, including .xls or .csv files
/opt/sisense/storage/dataL2021.3.1
Custom certificates used to connect to Sisense
/opt/sisense/storage/custom-certificatesL2021.3.1
External Plugins
/opt/sisense/storage/external-pluginsL2021.3.1
ServerSide Plugins
/opt/sisense/storage/serverSidePluginsL2021.3.1
Build Plugins
/opt/sisense/storage/build-pluginsL2021.3.1
Notebooks hosted on the Sisense server
/opt/sisense/storage/notebooksL2021.3.1
Custom language translations embedded in Sisense (see Changing the Sisense’s Language on Linux)/opt/sisense/storage/translationsL2021.3.1
Automated email configurations, such as dashboard reports or password reset emails (see Custom Email Servers)/opt/sisense/storage/emails
L2021.3.1
Usage Analytics
/opt/sisense/storage/usageL2021.5

SSL Certificates and Private Keys

The SSL certificates and private keys used to install Sisense are not automatically backed up when creating a tarball archive and must be backed up manually. With SSL in place, users access Sisense via HTTPS secure connection. So, it is recommended that these certificates are saved to a separate secure vault.

Video Explanations

For an overview about Backing Up and Restoring Sisense, watch this video:

To learn more about Backup Options, watch this video:


To learn more about Backup Export Options, watch this video:


To learn more about Restore Strategy, watch this video:


Where to Go From Here



Was this article helpful?