fix: update migration references in installer and README
This commit is contained in:
90
readme.md
90
readme.md
@@ -435,18 +435,88 @@ sha256sum -c SHA256SUMS.txt --ignore-missing
|
||||
|
||||
## Migration from v3.x
|
||||
|
||||
If you're upgrading from NUPST v3.x (Node.js-based), see [MIGRATION.md](./MIGRATION.md) for detailed migration instructions.
|
||||
If you're upgrading from NUPST v3.x (Node.js-based) to v4.0 (Deno-based), the migration is straightforward using the install.sh script.
|
||||
|
||||
**Key Changes in v4.0:**
|
||||
- Powered by Deno instead of Node.js
|
||||
- Distributed as pre-compiled binaries
|
||||
- New subcommand structure (backward compatible)
|
||||
- Zero dependencies required
|
||||
- Smaller installation footprint
|
||||
- Faster startup and execution
|
||||
### Quick Migration
|
||||
|
||||
**Configuration Compatibility:**
|
||||
Your existing `/etc/nupst/config.json` from v3.x is fully compatible with v4.0. No changes required.
|
||||
The installer script automatically handles the entire migration while preserving your configuration:
|
||||
|
||||
```bash
|
||||
# Run the installer (handles stop/update/restart automatically)
|
||||
curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh | sudo bash -s -- -y
|
||||
|
||||
# Verify
|
||||
nupst service status
|
||||
```
|
||||
|
||||
**That's it!** The installer automatically:
|
||||
- Detects your v3.x installation
|
||||
- Stops the running service
|
||||
- Replaces the binary with v4.0
|
||||
- Restarts the service
|
||||
- Preserves your `/etc/nupst/config.json` (fully compatible, no changes needed)
|
||||
|
||||
### Key Changes in v4.0
|
||||
|
||||
- **Runtime**: Node.js → Deno
|
||||
- **Distribution**: Git repository + npm packages → Pre-compiled binaries
|
||||
- **Installation**: Clone + setup.sh → Download binary via install.sh
|
||||
- **Dependencies**: Node.js + npm packages → Zero dependencies (self-contained binary)
|
||||
- **CLI Structure**: Flat commands → Subcommand structure (backward compatible)
|
||||
- **Updates**: `nupst update` → Re-run install.sh
|
||||
- **Footprint**: Single ~340MB self-contained binary (vs repo + node_modules in v3.x)
|
||||
- **Startup**: Seconds → Milliseconds
|
||||
|
||||
### Command Mapping
|
||||
|
||||
v4.0 uses a new subcommand structure, but **old commands still work** with deprecation warnings:
|
||||
|
||||
| v3.x Command | v4.0 Command | Notes |
|
||||
|-------------|--------------|-------|
|
||||
| `nupst enable` | `nupst service enable` | Old works with warning |
|
||||
| `nupst disable` | `nupst service disable` | Old works with warning |
|
||||
| `nupst start` | `nupst service start` | Old works with warning |
|
||||
| `nupst stop` | `nupst service stop` | Old works with warning |
|
||||
| `nupst status` | `nupst service status` | Old works with warning |
|
||||
| `nupst logs` | `nupst service logs` | Old works with warning |
|
||||
| `nupst add` | `nupst ups add` | Old works with warning |
|
||||
| `nupst edit [id]` | `nupst ups edit [id]` | Old works with warning |
|
||||
| `nupst delete <id>` | `nupst ups remove <id>` | Old works with warning |
|
||||
| `nupst list` | `nupst ups list` | Old works with warning |
|
||||
| `nupst test` | `nupst ups test` | Old works with warning |
|
||||
| `nupst config` | `nupst config show` | Old works with warning |
|
||||
|
||||
**New aliases:** `nupst ls` (list UPS devices), `nupst rm <id>` (remove UPS device)
|
||||
|
||||
### Configuration Compatibility
|
||||
|
||||
✅ **Fully Compatible:**
|
||||
- Configuration file format: `/etc/nupst/config.json`
|
||||
- All SNMP settings (host, port, community, version, security)
|
||||
- UPS device configurations (IDs, names, thresholds, groups)
|
||||
- Group configurations (redundant/non-redundant modes)
|
||||
- Supported UPS models (CyberPower, APC, Eaton, TrippLite, Liebert, custom OIDs)
|
||||
|
||||
### Troubleshooting Migration
|
||||
|
||||
**Service won't start after migration:**
|
||||
```bash
|
||||
# Re-enable service to update systemd file
|
||||
sudo nupst service disable
|
||||
sudo nupst service enable
|
||||
sudo nupst service start
|
||||
```
|
||||
|
||||
**Binary won't execute:**
|
||||
```bash
|
||||
sudo chmod +x /opt/nupst/nupst
|
||||
```
|
||||
|
||||
**Command not found:**
|
||||
```bash
|
||||
# Recreate symlink
|
||||
sudo ln -sf /opt/nupst/nupst /usr/local/bin/nupst
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
Reference in New Issue
Block a user