Compare commits

..

11 Commits
main ... main

1 changed files with 79 additions and 60 deletions

View File

@ -4,97 +4,116 @@ Update UNIT3D to the latest version by reviewing the release notes and following
## 1. Create Backup ## 1. Create Backup
UNIT3D offers built-in backups. Refer to the Backups documentation for usage. UNIT3D offers built-in backups. Refer to the [Backups documentation](/book/src/backups.md) for usage.
> [!IMPORTANT] > [!IMPORTANT]
> Ensure a complete backup is on hand before proceeding. > Ensure there is a complete backup before proceeding.
## 2. Enter Maintenance Mode ## 2. Enter Maintenance Mode
```sh ```bash
cd /var/www/html cd /var/www/html
php artisan down php artisan down
``` ```
## 3. Update UNIT3D ## 3. Update UNIT3D
Proceed to update UNIT3D: > [!NOTE]
> Before running the update, review the new releases minimum requirements to ensure the environment meets them.
Copy the latest backup to `~/tempBackup` before starting. 1. **Proceed to update:**
The updater will fetch the latest commits from the upstream repository and stage them for installation.
```sh ```bash
cd /var/www/html cd /var/www/html
php artisan git:update 2>&1 | tee ~/tempBackup/updateLogs.txt php artisan git:update
``` ```
3.1 UNIT3D fetches the new code and prompts for action on file conflicts. It is suggested to accept the updated files. After the update, review `~/tempBackup/updateLogs.txt` for conflicts. Any modifications will need to be re-implemented with the new code. There will be a prompt to confirm each step; choose `yes` to overwrite with the new version.
3.2 Run new migrations ```bash
Start the update process (yes/no) [yes]:
> yes
```
3.3 Install new packages 2. **Accept upstream files:**
3.4 When prompted for each changed file, type `yes` to overwrite the local copy or press `Enter` to accept the default shown in brackets.
## 4. Resume Site Functionality ```bash
Update config/unit3d.php (yes/no) [yes]:
> yes
On a successful update process; clear the cache, restart the PHP-FPM service, restart the Laravel queues, and finally bring the site live. git checkout origin/master -- config/unit3d.php
[============================] (Done!)
```
```sh 3. **Run new migrations:**
sudo php artisan set:all_cache && \
sudo systemctl restart php8.4-fpm && \
sudo php artisan queue:restart && \
sudo php artisan up
```
> [!TIP]
> If running external Unit3d-Announce, restart the supervisor services.
```sh ```bash
sudo supervisorctl reread && \ Run new migrations (php artisan migrate) (yes/no) [yes]:
sudo supervisorctl update && \ > yes
sudo supervisorctl reload ```
```
---
4. **Install new packages:**
```bash
Install new packages (composer install) (yes/no) [yes]:
> yes
```
5. **Compile assets:**
```bash
Compile assets (bun run build) (yes/no) [yes]:
> yes
```
## Troubleshooting Clean-up ## Troubleshooting Clean-up
During the update, an error related to a migration is a common occurance. It is important to review the error being described and make changes accordingly to clear any issues with the data at hand. The following commands are **optional** and should be run only as needed to resolve specific errors:
The below list of commands to finish a complete update process: - **Finish any migrations not completed:**
Finish any migrations not completed: ```sh
`sudo php artisan migrate` sudo php artisan migrate
```
Reinstall dependencies: - **Reinstall dependencies:**
`sudo -u www-data composer install --prefer-dist --no-dev -o`
Clear caches: ```sh
```sh composer install --prefer-dist --no-dev -o
sudo php artisan cache:clear && \ ```
sudo php artisan queue:clear && \
sudo php artisan auto:email-blacklist-update && \
sudo php artisan auto:cache_random_media && \
sudo php artisan set:all_cache
```
Rebuild static assets:
`bun install && bun run build`
Restart the PHP-FPM service: - **Clear caches:**
`sudo systemctl restart php8.4-fpm`
Restart the Laravel queues: ```sh
`sudo php artisan queue:restart` sudo php artisan cache:clear && \
sudo php artisan queue:clear && \
sudo php artisan auto:email-blacklist-update && \
sudo php artisan auto:cache_random_media && \
sudo php artisan set:all_cache
```
Bring the site live: - **Rebuild static assets:**
`sudo php artisan up`
> [!TIP] ```sh
> If running external Unit3d-Announce, restart the supervisor services. sudo bun install && sudo bun run build
```
```sh - **Restart services:**
sudo supervisorctl reread && \
sudo supervisorctl update && \ ```sh
sudo supervisorctl reload sudo systemctl restart php8.4-fpm && \
``` sudo php artisan queue:restart && \
sudo php artisan up
```
- **If running external UNIT3D-Announce, restart the supervisor services:**
```sh
sudo supervisorctl reread && \
sudo supervisorctl update && \
sudo supervisorctl reload
```