Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guideDeveloper guideAdmin guide
Company siteHelp center
English
  • Русский
  • English
v74
  • v74
  • v73
  • v72
Login
  • Getting Started
  • Administrator documentation
  • Functional characteristics
  • Technology description
  • System requirements
  • Admin Panel
  • Platform installation
  • Platform configuration
  • Platform maintenance
    • Personnel requirements
    • Platform maintenance processes
    • Platform updating
    • Platform service monitoring
    • Backup and recovery
    • Transferring the platform to a new server
    • Creating, deleting, and populating tables for statistics in ClickHouse
    • Usage of the aktool utility
    • Users and directories engaged by the platform
  • Custom channels guide
  • Extra
  • Processing HTTP/HTTPS traffic
  • Administrator API
  • Platform maintenance
  • Backup and recovery
Documentation for version v74

Backup and recovery

For full backup and recovery to work you will need the following data:

  • control module
  • MongoDB databases (account, control)
  • SSDB databases (actions, hb, notify, stat)
note

All of the backup methods create an archive in a user's current directory. Before executing the command, you must make sure that there is enough free space in the current directory to save the archive.

Control module​

Backup​

Archive control module data except *.pid и *.log files.

#!/usr/bin/env bash

tar -czf /backup/altcraft-$(date +%F).tar.gz /opt/altcraft --exclude=*.pid --exclude=*.log

Recovery​

Unpack the archive back on its place and restart control module.

#!/usr/bin/env bash

/opt/altcraft/akd restart
note

To restore the control module from a backup copy on a new server, you must first configure the environment necessary for the module to operate

MongoDB​

Data backup methods have their own documentation.
https://docs.mongodb.com/v3.4/core/backups/

tip

We recommend backing up using snapshots (see Back Up and Restore with Filesystem Snapshots). The method using snapshots allows you to save a lot of time when restoring "heavy" collections with a large number of indexes.

Backup​

Dump all databases and collections with the help of mongodump utility.
Use compression (--gzip) if you need.

mongodump utility description.
https://docs.mongodb.com/manual/reference/program/mongodump/

#!/usr/bin/env bash

mongodump --host 127.0.0.1 --port 27017 --gzip --archive=/backup/mongodb-control-$(date +%F).tar.gz
mongodump --host 127.0.0.1 --port 27018 --gzip --archive=/backup/mongodb-account-$(date +%F).tar.gz

Recovery​

Recower the data with mongorestore and restart systemd services.

mongorestore utility description.
https://docs.mongodb.com/manual/reference/program/mongorestore/

#!/usr/bin/env bash

mongorestore --host 127.0.0.1 --port 27017 --gzip --arcdhive=/backup/mongodb-control-2019-06-01.tar.gz
mongorestore --host 127.0.0.1 --port 27018 --gzip --arcdhive=/backup/mongodb-account-2019-06-01.tar.gz
systemctl restart mongod-control
systemctl restart mongod-account

SSDB​

tip

We recommend backing up using snapshots and then moving all data from the snapshot to an archive. Importing and exporting keys in large SSDB databases can take up to several days. Databases structure example.

/var/lib/ssdb
├── actions
│ ├── data
│ └── meta
├── hb
│ ├── data
│ └── meta
├── notify
│ ├── data
│ └── meta
└── stat
├── data
└── meta

Backup​

Archive catalogues, containing data and meta.

#!/usr/bin/env bash

tar -czf /backup/ssdb-actions-$(date +%F).tar.gz /var/lib/ssdb/actions
tar -czf /backup/ssdb-hb-$(date +%F).tar.gz /var/lib/ssdb/hb
tar -czf /backup/ssdb-notify-$(date +%F).tar.gz /var/lib/ssdb/notify
tar -czf /backup/ssdb-stat-$(date +%F).tar.gz /var/lib/ssdb/stat

Recovery​

Unpack the archive and restart systemd services.

#!/usr/bin/env bash

systemctl restart ssdb-actions
systemctl restart ssdb-hb
systemctl restart ssdb-notify
systemctl restart ssdb-stat
Last updated on Jul 14, 2023
Previous
Platform service monitoring
Next
Transferring the platform to a new server
  • Control module
    • Backup
    • Recovery
  • MongoDB
    • Backup
    • Recovery
  • SSDB
    • Backup
    • Recovery
© 2015 - 2025 Altcraft, LLC. All rights reserved.