Update upating_unit3d_version.md

This commit is contained in:
RKeaves 2025-04-30 19:28:45 -05:00
parent fbace9595d
commit 8749f03afc
1 changed files with 76 additions and 103 deletions

View File

@ -16,125 +16,98 @@ cd /var/www/html
php artisan down php artisan down
``` ```
## 3. Update Meilisearch ## 3. Update UNIT3D
- **Stop** the service and install the latest Meilisearch: > **Note:** Before running the actual update, make sure your environment meets the new releases minimum requirements.
```bash
sudo apt update
sudo apt upgrade
sudo systemctl stop meilisearch
sudo curl -L https://install.meilisearch.com | sudo sh
sudo mv ./meilisearch /usr/local/bin/
sudo chmod +x /usr/local/bin/meilisearch
sudo rm -rf /var/lib/meilisearch/data
```
- **Restart** Meilisearch:
```bash
sudo chmod +x /usr/local/bin/meilisearch
sudo systemctl start meilisearch
```
## 4. Update PHP
- **Refer** to the **Upgrading PHP Version** documentation.
## 5. Update UNIT3D
- **Proceed** to update UNIT3D after completing the PHP upgrade steps:
1. **Fetch and apply updates**
```bash ```bash
cd /var/www/html cd /var/www/html
php artisan git:update php artisan git:update
``` ```
During the update, UNIT3D prompts for action on file differences. Copy the latest backup to `~/tempBackup` before starting. After the update, review `~/tempBackup/fileConflicts.txt` for conflicts. 2. **Review and resolve conflicts**
## 6. Database Migration Fix 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.
During the update, an error related to the `tickets` table may occur: ![unit3d](https://ptpimg.me/vxefo6.png)
```sql
2025_02_17_074140_update_columns_to_boolean ......................................................................................... 38.50ms FAIL
In Connection.php line 825: ````bash
SQLSTATE[22004]: Null value not allowed: 1138 Invalid use of NULL value (Connection: mysql, SQL: alter table `tickets` modify `staff_read` tinyint(1) not null default '0') Update config/unit3d.php (yes/no) [yes]:
> yes
In Connection.php line 571: git checkout origin/master -- config/unit3d.php
SQLSTATE[22004]: Null value not allowed: 1138 Invalid use of NULL value [============================] (Done!)
```
**Resolve** `Null` values in `tickets` table: Update resources/sass/components/_quick_search.scss (yes/no) [yes]:
> yes
1. Log in to MySQL: ````
```bash
mysql -u your_username -p
```
**Enter** the MySQL password when prompted. After logging in, select the appropriate database by running:
```bash
USE your_database_name;
```
2. Fix the Null Values:
**Update** `NULL` entries in the `staff_read` column to `0` by running the following SQL command:
```sql
UPDATE tickets SET staff_read = 0 WHERE staff_read IS NULL;
```
3. Exit MySQL:
```sql
exit;
```
4. Complete migrations:
3. **Run new migrations**
```bash ```bash
php artisan migrate php artisan migrate
``` ```
---
## 7. Final Reset & Cleanup ## 4. Resume Site Functionality
- Clear caches, reinstall dependencies, rebuild assets, and restart services after updating and migrating. 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
sudo -u www-data 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 && \
bun install && \
bun run build && \
sudo php artisan migrate && \
sudo systemctl restart php8.4-fpm && \
sudo php artisan queue:restart && \
sudo supervisorctl reread && \
sudo supervisorctl update && \
sudo supervisorctl reload && \
sudo php artisan scout:sync-index-settings && \
sudo php artisan auto:sync_torrents_to_meilisearch --wipe && \
sudo php artisan auto:sync_people_to_meilisearch
```
- Resume normal site functionality:
```bash
sudo php artisan scout:sync-index-settings && \
sudo php artisan auto:sync_torrents_to_meilisearch --wipe && \
sudo php artisan auto:sync_people_to_meilisearch && \
sudo php artisan set:all_cache && \ sudo php artisan set:all_cache && \
sudo systemctl restart php8.4-fpm && \ sudo systemctl restart php8.4-fpm && \
sudo php artisan queue:restart && \ sudo php artisan queue:restart && \
sudo php artisan up 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.
```sh
sudo supervisorctl reread && \
sudo supervisorctl update && \
sudo supervisorctl reload
```