Compare commits

..

11 Commits
main ... main

1 changed files with 79 additions and 60 deletions

View File

@ -4,73 +4,90 @@ 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.
```bash
3.2 Run new migrations Start the update process (yes/no) [yes]:
> yes
3.3 Install new packages
3.4
## 4. Resume Site Functionality
On a successful update process; clear the cache, restart the PHP-FPM service, restart the Laravel queues, and finally bring the site live.
```sh
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 2. **Accept upstream files:**
sudo supervisorctl reread && \
sudo supervisorctl update && \ When prompted for each changed file, type `yes` to overwrite the local copy or press `Enter` to accept the default shown in brackets.
sudo supervisorctl reload
```bash
Update config/unit3d.php (yes/no) [yes]:
> yes
git checkout origin/master -- config/unit3d.php
[============================] (Done!)
``` ```
---
3. **Run new migrations:**
```bash
Run new migrations (php artisan migrate) (yes/no) [yes]:
> yes
```
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`
```sh
composer install --prefer-dist --no-dev -o
```
- **Clear caches:**
Clear caches:
```sh ```sh
sudo php artisan cache:clear && \ sudo php artisan cache:clear && \
sudo php artisan queue:clear && \ sudo php artisan queue:clear && \
@ -78,20 +95,22 @@ sudo php artisan auto:email-blacklist-update && \
sudo php artisan auto:cache_random_media && \ sudo php artisan auto:cache_random_media && \
sudo php artisan set:all_cache sudo php artisan set:all_cache
``` ```
Rebuild static assets:
`bun install && bun run build`
Restart the PHP-FPM service: - **Rebuild static assets:**
`sudo systemctl restart php8.4-fpm`
Restart the Laravel queues: ```sh
`sudo php artisan queue:restart` sudo bun install && sudo bun run build
```
Bring the site live: - **Restart services:**
`sudo php artisan up`
> [!TIP] ```sh
> If running external Unit3d-Announce, restart the supervisor services. 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 ```sh
sudo supervisorctl reread && \ sudo supervisorctl reread && \