Backup and Restore
This section details how to use the provided EverTrust Tools to back-up and restore Stream if deployed using the RPM package. If you deployed Stream using Docker/Kubernetes, the configuration should be backed-up using the Docker/Kubernetes management platform, and the database should be backed-up using MongoDB tools.
Backup Procedure
This section details how to back up Stream configuration elements (the /opt/stream/etc folder, that includes the Nginx configuration, and the /etc/default/stream configuration file) and the Stream MongoDB database.
The backup tool allows backing up these elements independently.
# /opt/stream/sbin/stream-backup --help
Stream Backup tool usage: stream-backup [-cdeho:q]
-c | --conf Backup the Stream configuration files
-d | --db Backup the Stream MongoDB Database
-e | --encrypt Encrypt the backup files with the specified passphrase
-h | --help Display the 'stream-backup' help
-o | --output [path] Specify the Stream backup output folder (default: '/opt/stream/var/backup')
-q | --quiet Quiet mode
To back up the configuration files, run the following command:
# /opt/stream/sbin/stream-backup -c
The configuration files backup consists of a compressed archive (.tar.gz
) located under /opt/stream/var/backup/
.
To back up the MongoDB database, run the following command:
# /opt/stream/sbin/stream-backup -d
The MongoDB database backup consists of a compressed file (.gz
) located under /opt/stream/var/backup/
.
To run a complete backup, execute the following command:
# /opt/stream/sbin/stream-backup -c -d
|
Restoration Procedure
This section details how to restore a Stream back-up that was generated using the stream-backup
tool.
The restoration happens using the stream-restore
tool.
# /opt/stream/sbin/stream-restore --help
Stream restore tool usage: stream-restore
-a | --archive [filepath] The encrypted backup file to restore
-c | --conf [filepath] The path to the Stream configuration backup file
-d | --db [filepath] The path to the Stream database backup file
-m | --mongo_uri [MongoDB URI] The MongoDB URI to back-up the database into (optional)
-h | --help Displays the 'stream-restore' help
-q | --quiet Quiet mode
Whenever trying to restore a backup, you need to stop the Stream service first:
# systemctl stop stream
To restore an unencrypted configuration backup, run the following command:
# /opt/stream/sbin/stream-restore -c [configuration backup archive path]
To restore an unencrypted MongoDB database backup, run the following command:
# /opt/stream/sbin/stream-restore -d [MongoDB backup archive path] -m [MongoDB URI]
The MongoDB URI is optional: if not provided, the script will try to infer it from the /etc/default/stream file. If it cannot be inferred and none is provided, the restore will fail.
To restore an encrypted backup archive, run the following command:
# /opt/stream/sbin/stream-restore -a [encrypted backup archive path] -m [MongoDB URI]
The restoration tool will prompt you for the passphrase that was used to encrypt the backup.
If the archive contains only a configuration backup, the script will perform the equivalent of the -c
parameter.
If the archive contains only a database backup, the script will perform the equivalent of the -d
parameter, and you might need to provide the MongoURI through the -m
parameter.
If the archive contains both a database and a configuration backup, both of them will be restored.
When the restoration is complete, you can start Stream again using the following command:
# systemctl start stream