Compare commits

..

2 Commits
main ... main

Author SHA1 Message Date
Eric Lay 927427f512 Update upating_unit3d_version.md 2025-04-30 06:30:38 -05:00
Eric Lay ba2ca333e7 Update upating_unit3d_version.md 2025-04-29 19:55:41 -05:00
1 changed files with 60 additions and 79 deletions

View File

@ -4,116 +4,97 @@ 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](/book/src/backups.md) for usage. UNIT3D offers built-in backups. Refer to the Backups documentation for usage.
> [!IMPORTANT] > [!IMPORTANT]
> Ensure there is a complete backup before proceeding. > Ensure a complete backup is on hand 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] Proceed to update UNIT3D:
> Before running the update, review the new releases minimum requirements to ensure the environment meets them.
1. **Proceed to update:** Copy the latest backup to `~/tempBackup` before starting.
The updater will fetch the latest commits from the upstream repository and stage them for installation.
```bash ```sh
cd /var/www/html cd /var/www/html
php artisan git:update php artisan git:update 2>&1 | tee ~/tempBackup/updateLogs.txt
``` ```
There will be a prompt to confirm each step; choose `yes` to overwrite with the new version. 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.
```bash
Start the update process (yes/no) [yes]:
> yes
```
2. **Accept upstream files:** 3.2 Run new migrations
When prompted for each changed file, type `yes` to overwrite the local copy or press `Enter` to accept the default shown in brackets. 3.3 Install new packages
```bash 3.4
Update config/unit3d.php (yes/no) [yes]:
> yes
git checkout origin/master -- config/unit3d.php ## 4. Resume Site Functionality
[============================] (Done!)
```
3. **Run new migrations:** On a successful update process; clear the cache, restart the PHP-FPM service, restart the Laravel queues, and finally bring the site live.
```bash ```sh
Run new migrations (php artisan migrate) (yes/no) [yes]: sudo php artisan set:all_cache && \
> yes 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.
4. **Install new packages:** ```sh
sudo supervisorctl reread && \
sudo supervisorctl update && \
sudo supervisorctl reload
```
---
```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
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 Finish any migrations not completed:
sudo php artisan migrate `sudo php artisan migrate`
```
- **Reinstall dependencies:** Reinstall dependencies:
`sudo -u www-data composer install --prefer-dist --no-dev -o`
```sh Clear caches:
composer install --prefer-dist --no-dev -o ```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`
- **Clear caches:** Restart the PHP-FPM service:
`sudo systemctl restart php8.4-fpm`
```sh Restart the Laravel queues:
sudo php artisan cache:clear && \ `sudo php artisan queue:restart`
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:** Bring the site live:
`sudo php artisan up`
```sh > [!TIP]
sudo bun install && sudo bun run build > If running external Unit3d-Announce, restart the supervisor services.
```
- **Restart services:** ```sh
sudo supervisorctl reread && \
```sh sudo supervisorctl update && \
sudo systemctl restart php8.4-fpm && \ sudo supervisorctl reload
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
```