Skip to content
NGX Storage Knowledge Base
< All Topics

Using Altinity Backup with NGX Storage S3 for ClickHouse Backups

Print

To securely and efficiently manage backups for your ClickHouse database, consider using the Altinity Backup Tool in conjunction with the NGX Storage S3. This setup offers a robust solution by leveraging ClickHouse’s powerful analytics capabilities while ensuring data integrity through reliable backups stored on the on-premise NGX Storage S3 service. By following a step-by-step guide, you can install and configure each component, ensuring seamless integration and optimal performance.

This guide assumes ClickHouse is already installed and configured on your system. It focuses on configuring Altinity Backup Tool to utilize NGX Storage S3 for storing backups.

Step 1: Install Alinity ClickHouse Backup same host with ClickHouse

Find proper version for your server in here.

For RPM package:

# sudo rpm -i clickhouse-backup-*x86_64.rpm

For DEB package:

# sudo dpkg -i clickhouse-backup_*amd64.deb

Step 2: Configure NGX Storage S3 Bucket

1. Under Shares->S3 menu, click Add S3 User button. Below example we add “clickhouse-backup” user.  Do not forget to copy the secret key !

2. Create a new bucket and assign user to access it.

Step 3: Configure Alinity ClickHouse Backup

# touch /etc/clickhouse-backup/config.yml

Create the configuration file at /etc/clickhouse-backup/config.yml with the following content:

general:
  allow_empty_backups: false
  backups_to_keep_local: 0
  backups_to_keep_remote: 0
  download_concurrency: 2
  log_level: info
  max_file_size: 1073741824
  remote_storage: s3
  upload_concurrency: 2
clickhouse:
  username: default
  password: ""
  host: localhost
  port: 9000
  skip_tables:
  - system.*
  - INFORMATION_SCHEMA.*
  - information_schema.*
s3:
  access_key: "clickhouse-backup" # username of S3 user
  secret_key: "" # created by NGX Storage device after created S3 user
  bucket: "clickhouse-backup"
  acl: private
  debug: false
  disable_cert_verification: true
  endpoint: "http://192.168.1.19:9000"
  force_path_style: true

Step 4: Initialize and Backup

Create a full backup:

# sudo clickhouse-backup create [backup_name]

Upload backup:

# sudo clickhouse-backup upload [backup_name]

Delete backup from local:

# sudo clickhouse-backup delete local [backup_name]

Step 5: Restore Backup

Drop databases from Clickhouse cluster before restore.

Download the backup:

# sudo clickhouse-backup download [backup_name]

Restore Backup:

# sudo clickhouse-backup restore --rbac --configs --drop [backup_name]

“–drop”: Drop exists schema objects before restore

“–rbac”: Restore RBAC related objects

“–configs”: Restore ‘clickhouse-server’ CONFIG related files

Reference Links

 

COPYRIGHT
© 2025 NGX Teknoloji A.Ş. (NGX Storage). All rights reserved. Printed in the Turkey. Specifications subject to change without notice. No part of this document covered by copyright may be reproduced in any form or by any means-graphic, electronic, or mechanical, including photocopying, recording, taping, or storage in an electronic retrieval system-without prior written permission of NGX Storage. Software derived from copyrighted NGX Storage material is subject to the following license and disclaimer:

THIS SOFTWARE IS PROVIDED BY NGX Storage “AS IS” AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL NGX Storage BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

NGX Storage reserves the right to change any products described herein at any time, and without notice. NGX Storage assumes no responsibility or liability arising from the use of products described herein, except as expressly agreed to in writing by NGX Storage. The use or purchase of this product does not convey a license under any patent rights, trademark rights, or any other intellectual property rights of NGX Storage.

TRADEMARK

NGX Storage and the NGX Storage logo are trademarks of NGX TEKNOLOJI A.Ş. Other company and product names may be trademarks of their respective owners.