Introduction
Objective of the document
This document describes the procedure of back the data of a Systran Enterprise Server to restore it to its current functional state in case of a server failure or data loss. Before proceeding with this procedure, kindly verify that the archive location has enough disk space to contain the archived data.
Requirements
The following procedure has been validated with:
• RHEL 7.2
• Mongodb v3.2.x
• SES 8.x
3 Procedure
3.1 Anticipate the possible size of your archive
Verify the size of your database present in mongo and the size of the workspace directory.
To check the size of the workspace directory :
du -sh /opt/systran/translation-resource-monitor/workspace
Check the size of mongoDB database
(refer to https://docs.mongodb.com/manual/reference/command/dbStats/)
or on your server terminal:
du -sh /var/lib/mongo/
3.2 Backup
Choose a destination for the archive:
SES_ARCHIVE=archive_$(date +%Y-%m-%d) && export SES_ARCHIVE
mkdir -p /home/systran/$SES_ARCHIVE
mongodump --out /home/systran/$SES_ARCHIVE/mongodump
Copy the directory "workspace" of TRM containing the Translation resources :
mkdir -p /home/systran/$SES_ARCHIVE/opt/systran/translation-resource-monitor
cp -a /opt/systran/translation-resource-monitor/workspace /home/systran/$SES_ARCHIVE/opt/systran/translation-resource-monitor
Save the Tm-indexer contents :
mkdir -p /home/systran/$SES_ARCHIVE/opt/systran/tm-indexer/data
cp -a /opt/systran/tm-indexer/data /home/systran/$SES_ARCHIVE/opt/systran/tm-indexer
The config file of SES components:
for i in $(find /opt/systran/ -type d -name "etc" | grep -v "apps-node"); do mkdir -p /home/systran/$SES_ARCHIVE/$i && cp -a $i/* /home/systran/$SES_ARCHIVE/$i; done
for i in $(find /opt/systran/apps-node/ -type d -name "config" | grep -v "node_modules"); do mkdir -p /home/systran/$SES_ARCHIVE/$i && cp -a $i/* /home/systran/$SES_ARCHIVE/$i; done
The config files of the Systran 3rd party dependencies:
for i in {mongod.conf,redis.conf,rabbitmq.config,rabbitmq-env.conf,rsyslog.conf,systran_ses_limits.conf,elasticsearch.yml}; do j=$(find /etc -name $i) && mkdir -p /home/systran/$SES_ARCHIVE/$(dirname $j) && cp -a $j /home/systran/$SES_ARCHIVE/$(dirname $j); done
Create a backup of /etc/yum.repos.d/ to avoid a recreation of repositories during the installation:
for i in $(find /etc/yum.repos.d/ -type f -name "*.repo" | grep -v "CentOS*"); do mkdir -p /home/systran/$SES_ARCHIVE/etc/yum.repos.d && cp -a $i /home/systran/$SES_ARCHIVE/etc/yum.repos.d; done
Copy the Systran License file from its parent location:
mkdir -p /home/systran/$SES_ARCHIVE/opt/systran/apps-node/enterprise-server/etc
cp -a /opt/systran/apps-node/enterprise-server/etc/ /home/systran/$SES_ARCHIVE/opt/systran/apps-node/enterprise-server/etc
3.3 Compress the archive and move it to a remote storage location
tar -cvf $SES_ARCHIVE.tar.gz /home/systran/$SES_ARCHIVE
check the data after the compression:
cksum $SES_ARCHIVE.tar.gz
Copy it to a distant location and verify the data with checksum again to make sure that there aren’t corruption
3.4 Backup policy
It is advised to perform the backup of the server following changes such as insertion of new resources or glossaries. In case of high usage and modifications, the backup should be done in a frequent interval, such as once per week.
3.5 Restore
It is advised to get in touch with your Systran technical representative to perform the restoration procedure.