Umami和NodeStatus都是通过1Panel使用docker安装的,该服务器被攻击当成了矿机,所以为了安全起见重装系统重新安装,由此记录备份方法。
备份方法来自于ChatGPT
NodeStatus
备份NodeStatus
NodeStatus的数据库文件存放在
/usr/local/NodeStatus/server
所以直接备份该目录下的db.sqlite即可,到时候重装NodeState后替换数据库文件即可。
安装NodeStatus
# Install Docker with docker-compose v2
curl -fsSL https://get.docker.com | bash -s docker
docker --version
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose # for x86_64
chmod +x ~/.docker/cli-plugins/docker-compose
# Download docker-compose.yml
mkdir ~/nodestatus
cd ~/nodestatus
wget https://raw.githubusercontent.com/cokemine/nodestatus/master/docker-compose.yml
vim docker-compose.yml #修改环境变量相关配置
docker compose up -d
# How to Update
cd ~/nodestatus
docker compose down
docker pull cokemine/nodestatus:latest
docker compose up -d
备份旧的docker-compose.yml
cd /app/NodeStatus
rclone copy -P docker-compose.yml onedrive:/Bero/NodeStatus/
备份db.sqlite文件
cd /usr/local/NodeStatus/server
rclone copy -P db.sqlite onedrive:/Bero/NodeStatus/
Umami
备份Umami数据库
umami-db-1是容器名称,/app/Umami是
docker exec umami-db-1 pg_dump -U umami umami > /app/Umami/umami_backup.sql
安装Umami
下载docker-compose.yml文件
https://raw.githubusercontent.com/umami-software/umami/master/docker-compose.yml
docker compose up -d
恢复Umami数据库
cat /app/Umami/umami_backup.sql | docker exec -i umami-db-1 psql -U umami -d umami