You've already forked dokuwiki-updater-ubuntu
189 lines
3.8 KiB
Markdown
189 lines
3.8 KiB
Markdown
|
|
# DokuWiki Updater for Ubuntu 24.04 Server
|
|||
|
|
[](#)
|
|||
|
|
[](#)
|
|||
|
|
[](#)
|
|||
|
|
[](#)
|
|||
|
|
[](./LICENSE)
|
|||
|
|
|
|||
|
|
Update DokuWiki installations safely on Ubuntu 24.04 server.
|
|||
|
|
|
|||
|
|
This updater replaces core files only and does not modify the `data` directory.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Why this updater exists
|
|||
|
|
|
|||
|
|
DokuWiki’s built-in upgrade plugins sometimes fail due to permissions, plugin conflicts, or incomplete updates.
|
|||
|
|
|
|||
|
|
This updater provides:
|
|||
|
|
|
|||
|
|
- predictable updates
|
|||
|
|
- scheduled updates via cron
|
|||
|
|
- automatic backups
|
|||
|
|
- clear logging
|
|||
|
|
|
|||
|
|
The goal is stability and long-term maintainability.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## What this updater does
|
|||
|
|
|
|||
|
|
✔ Detects installed version
|
|||
|
|
✔ Downloads latest stable release
|
|||
|
|
✔ Compares versions before updating
|
|||
|
|
✔ Clears cache before backup
|
|||
|
|
✔ Creates compressed core backup
|
|||
|
|
✔ Replaces core files safely
|
|||
|
|
✔ Leaves `data/` untouched
|
|||
|
|
✔ Logs every run
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## What this updater does NOT do
|
|||
|
|
|
|||
|
|
It won’t stop you from running the script without reading the documentation like there’s no tomorrow.
|
|||
|
|
Skip the README, and whatever happens next is your headache, not a bug report.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Compatibility
|
|||
|
|
|
|||
|
|
This updater is guaranteed to work on systems installed using:
|
|||
|
|
|
|||
|
|
- [DokuWiki for Ubuntu 24.04 Server](https://git.x-files.dk/webapps/dokuwiki-ubuntu)
|
|||
|
|
|
|||
|
|
Other installation methods may use different paths or layouts.
|
|||
|
|
You are free to modify the script if your environment differs.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 1. Clone
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
git clone https://git.x-files.dk/webapps/dokuwiki-updater-ubuntu.git
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
cd dokuwiki-updater-ubuntu
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 2. Install
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
sudo install -m 755 dokuwikiupdate /usr/local/sbin/dokuwikiupdate
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 3. Run manually
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
sudo dokuwikiupdate /var/www/html/wiki.example.com
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Automatic Updates (Cron)
|
|||
|
|
|
|||
|
|
Example weekly update:
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
# Minute Hour Day Month DayOfWeek User Command
|
|||
|
|
15 5 * * 5 root /usr/local/sbin/dokuwikiupdate /var/www/html/wiki.example.com >/dev/null 2>&1
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
Logs are written to:
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
/var/log/dokuwiki/
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Running multiple wikis on one server
|
|||
|
|
|
|||
|
|
If you run several DokuWiki instances, schedule updates at different times rather than running them simultaneously.
|
|||
|
|
|
|||
|
|
Example:
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
# Test wiki (Monday)
|
|||
|
|
5 5 * * 1 root /usr/local/sbin/dokuwikiupdate /var/www/html/wiki-test >/dev/null 2>&1
|
|||
|
|
|
|||
|
|
# Production wiki (Thursday)
|
|||
|
|
5 5 * * 4 root /usr/local/sbin/dokuwikiupdate /var/www/html/wiki-prod >/dev/null 2>&1
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
This allows time to verify updates before production is updated.
|
|||
|
|
|
|||
|
|
Running multiple updates at the exact same time is not recommended.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Backup Behavior
|
|||
|
|
|
|||
|
|
Before updating, the script creates a compressed backup of core files only:
|
|||
|
|
|
|||
|
|
- `conf/`
|
|||
|
|
- `lib/`
|
|||
|
|
- core PHP files
|
|||
|
|
|
|||
|
|
The following are NOT backed up:
|
|||
|
|
|
|||
|
|
- `data/`
|
|||
|
|
- cache
|
|||
|
|
- plugins
|
|||
|
|
|
|||
|
|
Backups are stored in:
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
/var/log/dokuwiki/
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
Only one backup per wiki is kept to prevent filling the filesystem.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Logging
|
|||
|
|
|
|||
|
|
Each wiki has its own log file:
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
/var/log/dokuwiki/<wiki-path>.log
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
Logs include:
|
|||
|
|
|
|||
|
|
- version checks
|
|||
|
|
- backup operations
|
|||
|
|
- update results
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Disk Space
|
|||
|
|
|
|||
|
|
Before creating a backup, the script estimates required space and aborts safely if insufficient space is available.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Troubleshooting
|
|||
|
|
|
|||
|
|
| Issue | Cause | Fix |
|
|||
|
|
|--------|--------|--------|
|
|||
|
|
| No update occurs | Already latest version | Normal behavior |
|
|||
|
|
| Backup fails | Disk full or permissions | Check `/var/log` |
|
|||
|
|
| Update fails | Permission or path issue | Check log file |
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### More Information
|
|||
|
|
|
|||
|
|
More guides and documentation can be found on [wiki.x-files.dk](https://wiki.x-files.dk)
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### License
|
|||
|
|
Licensed under the [MIT License](./LICENSE).
|