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,113 +1,115 @@
# 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]
> Ensure you have a complete backup before proceeding.
> **Important:** Ensure there is a complete backup before proceeding.
## 2. Enter Maintenance Mode
## 2. Enter Maintenance Mode:
```bash
```sh
cd /var/www/html
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**
```bash
1. **Proceed to update:**
The updater will fetch the latest commits from the upstream repository and stage them for installation.
```sh
cd /var/www/html
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.
![unit3d](https://ptpimg.me/vxefo6.png)
````bash
Update config/unit3d.php (yes/no) [yes]:
> yes
git checkout origin/master -- config/unit3d.php
[============================] (Done!)
Update resources/sass/components/_quick_search.scss (yes/no) [yes]:
> yes
````
3. **Run new migrations**
```bash
php artisan migrate
```sh
Start the update process (yes/no) [yes]:
> yes
```
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.
## 4. Resume Site Functionality
```sh
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!)
```
3. **Run new migrations:**
```sh
Run new migrations (php artisan migrate) (yes/no) [yes]:
> yes
```
4. **Install new packages:**
```sh
Install new packages (composer install) (yes/no) [yes]:
> yes
```
5. **Compile assets:**
```sh
Compile assets (bun run build) (yes/no) [yes]:
> yes
```
## Troubleshooting Clean-up:
The following commands are **optional** and should be run only as needed to resolve specific errors:
- **Finish any migrations not completed:**
```sh
sudo php artisan migrate
```
- **Reinstall dependencies:**
```sh
composer install --prefer-dist --no-dev -o
```
- **Clear caches:**
```sh
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:**
```sh
sudo bun install && sudo bun run build
```
- **Restart services:**
```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
sudo supervisorctl reread && \
sudo supervisorctl update && \
sudo supervisorctl reload
```
---
## 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 below list of commands to finish a complete update process:
Finish any migrations not completed:
`sudo php artisan migrate`
Reinstall dependencies:
`sudo -u www-data composer install --prefer-dist --no-dev -o`
Clear caches:
```sh
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:
`sudo systemctl restart php8.4-fpm`
Restart the Laravel queues:
`sudo php artisan queue:restart`
Bring the site live:
`sudo php artisan up`
> [!TIP]
> If running external Unit3d-Announce, restart the supervisor services.
- **If running external UNIT3D-Announce, restart the supervisor services:**
```sh
sudo supervisorctl reread && \
sudo supervisorctl update && \
sudo supervisorctl reload
```
```