CodeNewbie Community 🌱

Sharon428931
Sharon428931

Posted on

How to Upgrade SafeLine WAF the Right Way

Before upgrading SafeLine, please review the SafeLine Changelog.

Upgrading SafeLine will restart the service and cause a brief traffic interruption. Choose an appropriate time based on your business activity.


🔒 Step 1: Back Up Your SafeLine Data

Upgrading usually includes data migration and cannot be undone. If you ever want to restore or downgrade, back up your SafeLine data first.

# Enter SafeLine directory
cd <safeline-directory>

# Stop SafeLine service
docker compose down

# Back up SafeLine data
cp -r <safeline-directory> <backup-path>

# Restart SafeLine service
docker compose up -d
Enter fullscreen mode Exit fullscreen mode

⚡ Step 2: Automatic Upgrade (Recommended)

You do not need to stop SafeLine before this operation.

bash -c "$(curl -fsSLk https://waf.chaitin.com/release/latest/manager.sh)" -- --en
Enter fullscreen mode Exit fullscreen mode

If the command runs successfully, the upgrade is complete.


🛡️ Upgrade Guide for LTS Version (8.0)

⚠️ Do NOT run this if you're on version 8.1 or higher, as downgrading will corrupt your data.

To upgrade from versions earlier than 8.x to the 8.0 LTS version:

bash -c "$(curl -fsSLk https://waf-ce.chaitin.cn/release/latest/manager.sh)" -- --en --lts
Enter fullscreen mode Exit fullscreen mode

🛠️ Manual Upgrade Instructions

1. Check .env Configuration

cd <safeline-directory>
cat .env
Enter fullscreen mode Exit fullscreen mode

Ensure your .env file includes the following fields:

SAFELINE_DIR=******
IMAGE_TAG=******
MGT_PORT=******
POSTGRES_PASSWORD=******
SUBNET_PREFIX=******
IMAGE_PREFIX=******
ARCH_SUFFIX=******
RELEASE=******
REGION=-g
Enter fullscreen mode Exit fullscreen mode

🚨 Missing fields may cause data corruption. Contact the developers via Discord if needed.


2. Download Latest Docker Compose Script

cd <safeline-directory>
wget "https://waf.chaitin.com/release/latest/compose.yaml"
Enter fullscreen mode Exit fullscreen mode

3. Pull Latest Docker Image

cd <safeline-directory>
docker compose pull
Enter fullscreen mode Exit fullscreen mode

4. Restart SafeLine Service

cd <safeline-directory>
docker compose down --remove-orphans && docker compose up -d
Enter fullscreen mode Exit fullscreen mode

If the command completes without error, your upgrade was successful!


✅ Final Step

Visit the SafeLine Web Admin Console to confirm the new version is running properly.


🤝 Join the Community

Interested in discussing bot protection strategies? Join the SafeLine WAF community:

Top comments (0)