Skip to content
Proyek

distillium/remnawave-backup-restore

Lihat di GitHub

Tentang

Backup and restore script for Remnawave directory and database

Data dan analisis

Cara angka ini diukur

382 bintang46 Fork +2 dalam 24 jam

Pertumbuhan bintang terukur

dalam 24 jam
+2
dalam 7 hari
+5
dalam 15 hari
+17
dalam 1 bulan
Mengumpulkan riwayat

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli
Remnawave Backup & Restore

Backup and restore for the Remnawave panel and your Telegram shop:
scheduled, to Telegram or S3, encrypted, with selective restore.

English · Русский

What the menu looks like
Main menu

[!CAUTION] The script backs up only the Remnawave directory and database and, optionally, a Telegram shop. Other services are up to you.

[!IMPORTANT] Google Drive is not supported since 4.3.0: the script switches to Telegram on its own. For backups over 50 MB, connect S3.

Installation

curl -o ~/backup-restore.sh https://raw.githubusercontent.com/distillium/remnawave-backup-restore/main/backup-restore.sh && chmod +x ~/backup-restore.sh && ~/backup-restore.sh

Requires root. After installation, open the menu with rw-backup.

Details

Features
  • manual or scheduled backups: panel and bot, panel only or bot only
  • the panel's Docker database and external PostgreSQL
  • upload to Telegram (direct chat or group topic) or to S3 storage, up to 5 at once
  • retention on the server (days or hours) and in each S3 separately
  • disk and S3 usage, with an optional S3 limit
  • encryption with an age key
  • selective restore: everything, database only or files only
  • S3 and Telegram proxy tests with clear error diagnostics
  • new version notices and auto-update
Menu
# Item Inside
1 Create backup now a backup with the current settings
2 Restore from backup pick an archive and what to restore
3 What to back up panel, bot, backup mode
4 Where to send Telegram or S3, list of storages
5 Schedule and retention schedule and retention periods
6 Settings Telegram, encryption, language, auto-update
7 Logs backup, restore, errors, cron
Selective restore

If a backup has both a database and files, the script asks what to restore:

Option What happens
Everything database and files
Database only the DB volume is recreated, files are left as they are. The panel or bot must already be installed
Files only files and settings are replaced, the database is left as it is

Handy for rolling back only the database after a failed update.

Encryption

Turn it on in Settings → Encryption. Backups are encrypted with an age public key, and only that key is kept on the server. To restore, the script asks for the private key.

Important: without the private key an encrypted backup can't be restored. Keep it away from the server.

Supported bots
Bot Directory
Jesus Bot remnawave-telegram-shop
Private Jesus Bot rwp-shop
Machka Bot remnawave-tg-shop
Snoups Bot remnashop
Minishop Bot remnawave-minishop
Moving to another server
◦ Panel only: moving to a new server
  1. In Cloudflare, point the panel subdomain to the new IP. If other services move to the new server too, update their subdomains as well.
  2. Restore the directory and the database.
  3. Restore the domain certificates if needed.
  4. The access link and password stay the same as in the old panel the backup was made from.
  5. On every node, replace the rule for the service port (2222 by default) so the panel on the new IP can reach them. Run on each node, with your own OLD_IP and NEW_IP:
ufw delete allow from OLD_IP to any port 2222 && ufw allow from NEW_IP to any port 2222

Done. All that's left is to install and set up the other services you need (e.g. kuma, beszel).

◦ Panel + node: moving to a new server
  1. In Cloudflare, point the subdomains of the panel and the "root" node (the one on the panel server) to the new IP. If other services move to the new server too, update their subdomains as well.
  2. Restore the domain certificates if needed.
  3. Restore the directory and the database.
  4. Open panel access via port 8443 (eGames script, "Panel access management").
  5. The access link and password stay the same as in the old panel the backup was made from.
  6. In node management, find the root node. It has the old server address: change it to the new one and the node comes up on its own.
  7. Close panel access via port 8443 the same way you opened it.
  8. On every external node, replace the rule for the service port (2222 by default). Run on each node, with your own OLD_IP and NEW_IP:
ufw delete allow from OLD_IP to any port 2222 && ufw allow from NEW_IP to any port 2222

Done. All that's left is to install and set up the other services you need (e.g. kuma, beszel).

◦ Panel + node → "Panel only" on the current server
  1. Restore the directory and the database.
  2. The access link and password stay the same as in the old panel the backup was made from.
  3. Delete the old "root" node from the panel together with its inbound and host.
  4. Delete the .env-node file from the panel server:
rm /opt/remnawave/.env-node

Done. All that's left is to install and set up the other services you need (e.g. kuma, beszel).

◦ Panel + node → "Panel only" on a new server
  1. In Cloudflare, point the panel subdomain to the new IP. If other services move to the new server too, update their subdomains as well.
  2. Restore the domain certificates if needed.
  3. Restore the directory and the database.
  4. The access link and password stay the same as in the old panel the backup was made from.
  5. Delete the old "root" node from the panel together with its inbound and host.
  6. Delete the .env-node file from the panel server:
rm /opt/remnawave/.env-node
  1. On every node, replace the rule for the service port (2222 by default). Run on each node, with your own OLD_IP and NEW_IP:
ufw delete allow from OLD_IP to any port 2222 && ufw allow from NEW_IP to any port 2222

Done. All that's left is to install and set up the other services you need (e.g. kuma, beszel).

Commands and files
Command What it does
rw-backup open the menu
rw-backup backup back up without the menu (this is what the schedule runs)
rw-backup restore restore
rw-backup update update the script
rw-backup remove remove the script

Everything lives in /opt/rw-backup-restore: settings in config.env, backups in backup/, logs in logs/.

Support the Project

Donate via Telegram   Donate via Tribute Web

Thank you for your support!

Jelajahi proyek terkait

Memuat…