Updating
Updating
Because GO Shortener compiles into a standalone, single-executable binary with embedded frontend assets, upgrading to a new version is simple and carries zero risk of overwriting your configuration or stored data.
/root/Go-shortner/data/go.sqlite) or your .env configuration file.Method 1: Automated Update via Installer Script
If you installed GO using the official installer script, rerun the script directly on your server:
sudo bash /root/Go-shortner/install.sh
The script automatically:
- Detects your CPU architecture.
- Queries the GitHub API for the latest release tag.
- Stops
go-shortener.service. - Replaces
/root/Go-shortner/go-shortenerwith the new binary. - Preserves
.envand all SQLite database files intact. - Restarts
go-shortener.serviceand checks health.
Method 2: Manual Update Process
Follow this recommended 7-step procedure to perform a controlled manual upgrade:
1. Download the New Release Binary
Download the latest prebuilt binary from the GitHub Releases page to a temporary location:
# For x86_64 servers
curl -L -o /tmp/go-shortener-new https://github.com/ItsARCn/Go-shortner/releases/latest/download/go-shortener-linux-amd64
# For ARM64 servers
curl -L -o /tmp/go-shortener-new https://github.com/ItsARCn/Go-shortner/releases/latest/download/go-shortener-linux-arm64
# Ensure executable permissions
chmod +x /tmp/go-shortener-new
2. Stop the Application Service
Gracefully stop the running systemd service:
systemctl stop go-shortener
3. Replace the Binary
Move the new binary into place, overwriting the previous executable:
mv /tmp/go-shortener-new /root/Go-shortner/go-shortener
4. Preserve the .env Configuration
Confirm that /root/Go-shortner/.env remains untouched and contains your existing JWT_SECRET and keys.
# Verify configuration exists and permissions are intact
ls -l /root/Go-shortner/.env
5. Preserve the SQLite Database
Confirm that your SQLite database directory /root/Go-shortner/data/ has not been modified:
# Verify database files are present
ls -lh /root/Go-shortner/data/go.sqlite
6. Start the Service
Start the updated application service:
systemctl start go-shortener
7. Verify the Service
Check the service status and inspect the health check endpoint:
# Check systemd status
systemctl status go-shortener
# Query the internal health endpoint
curl -s http://127.0.0.1:3000/api/health
Rollback Procedure
If you ever encounter an issue with a new release:
- Stop the service:
systemctl stop go-shortener - Download the previous release binary tag from GitHub releases (e.g.
v1.0.0). - Replace
/root/Go-shortner/go-shortener. - Restart the service:
systemctl start go-shortener. - Your database and environment configuration remain untouched.