Update upating_unit3d_version.md

This commit is contained in:
RKeaves 2025-05-04 09:42:02 -05:00
parent 8749f03afc
commit 4913faf5e1
1 changed files with 81 additions and 79 deletions

View File

@ -1,89 +1,89 @@
# Updating UNIT3D # Updating UNIT3D
Update UNIT3D and its dependencies following the steps below. Update UNIT3D to the latest version by reviewing the release notes and following the steps below:
## 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](docs/backups.md) for usage.
> [!IMPORTANT] > **Important:** Ensure there is a complete backup before proceeding.
> Ensure you have a complete backup before proceeding.
## 2. Enter Maintenance Mode ## 2. Enter Maintenance Mode:
```bash ```sh
cd /var/www/html cd /var/www/html
php artisan down php artisan down
``` ```
## 3. Update UNIT3D ## 3. Update UNIT3D:
> **Note:** Before running the actual update, make sure your environment meets the new releases minimum requirements. > **Tip:** Before running the update, review the new releases minimum requirements to ensure the environment meets them.
1. **Fetch and apply updates** 1. **Proceed to update:**
```bash The updater will fetch the latest commits from the upstream repository and stage them for installation.
```sh
cd /var/www/html cd /var/www/html
php artisan git:update php artisan git:update
``` ```
2. **Review and resolve conflicts** There will be a prompt to confirm each step; choose `yes` to overwrite with the new version.
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. ```sh
Start the update process (yes/no) [yes]:
> yes
```
![unit3d](https://ptpimg.me/vxefo6.png) 2. **Accept upstream files:**
When prompted for each changed file, type `yes` to overwrite the local copy or press Enter to accept the default shown in brackets.
```sh
````bash
Update config/unit3d.php (yes/no) [yes]: Update config/unit3d.php (yes/no) [yes]:
> yes > yes
git checkout origin/master -- config/unit3d.php git checkout origin/master -- config/unit3d.php
[============================] (Done!) [============================] (Done!)
```
Update resources/sass/components/_quick_search.scss (yes/no) [yes]: 3. **Run new migrations:**
```sh
Run new migrations (php artisan migrate) (yes/no) [yes]:
> yes > yes
````
3. **Run new migrations**
```bash
php artisan migrate
``` ```
4. **Install new packages:**
## 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 ```sh
sudo php artisan set:all_cache && \ Install new packages (composer install) (yes/no) [yes]:
sudo systemctl restart php8.4-fpm && \ > yes
sudo php artisan queue:restart && \
sudo php artisan up
``` ```
> [!TIP]
> If running external Unit3d-Announce, restart the supervisor services. 5. **Compile assets:**
```sh ```sh
sudo supervisorctl reread && \ Compile assets (bun run build) (yes/no) [yes]:
sudo supervisorctl update && \ > yes
sudo supervisorctl reload
``` ```
---
## Troubleshooting Clean-up:
## Troubleshooting Clean-up The following commands are **optional** and should be run only as needed to resolve specific errors:
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. - **Finish any migrations not completed:**
The below list of commands to finish a complete update process: ```sh
sudo php artisan migrate
```
Finish any migrations not completed: - **Reinstall dependencies:**
`sudo php artisan migrate`
Reinstall dependencies: ```sh
`sudo -u www-data composer install --prefer-dist --no-dev -o` 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 && \
@ -91,20 +91,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 && \