From 0b55074e5f15ddc47460021a52a2d3168f335c37 Mon Sep 17 00:00:00 2001 From: RKeaves Date: Mon, 28 Apr 2025 11:51:32 -0500 Subject: [PATCH] Update upating_unit3d_version.md --- upating_unit3d_version.md | 59 +++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/upating_unit3d_version.md b/upating_unit3d_version.md index 302deb5..1976bee 100644 --- a/upating_unit3d_version.md +++ b/upating_unit3d_version.md @@ -5,24 +5,7 @@ _Whether you're upgrading from UNIT3D v8.3.3 to v9.0.1 or updating your PHP envi > [!IMPORTANT] > backup. -## 1. Create a Backup - -UNIT3D provides built-in backup tools through PHP Artisan. - -## 2. Table of Contents - -- [Prerequisites](#3-prerequisites) -- [Update Procedures](#4-update-procedures) - - [4.1 Enter Maintenance Mode & Prepare Meilisearch](#41-enter-maintenance-mode--prepare-meilisearch) - - [4.2 Update PHP to 8.4](#42-update-php-to-84) - - [4.3 Update UNIT3D](#43-update-unit3d) - - [4.4 Database Migration Fix](#44-database-migration-fix) -- [Post-Update Procedures](#5-post-update-procedures) -- [Troubleshooting](#6-troubleshooting) - ---- - -## 3. Prerequisites +## Prerequisites - Complete backup in `~/tempBackup` - Sudo privileges @@ -34,11 +17,13 @@ UNIT3D provides built-in backup tools through PHP Artisan. curl, apt, nginx, mysql/mariadb, nano/micro ``` ---- +## 1. Create a Backup -## 4. Update Procedures +UNIT3D provides built-in backup tools through PHP Artisan. -### 4.1 Enter Maintenance Mode & Prepare Meilisearch +## 2. Update Procedures + +### 2.1 Enter Maintenance Mode & Prepare Meilisearch ```bash cd /var/www/html @@ -65,7 +50,7 @@ sudo chmod +x /usr/local/bin/meilisearch sudo systemctl start meilisearch ``` -### 4.2 Update PHP to 8.4 +### 2.2 Update PHP to 8.4 Add PHP Repository & Update Package Lists: @@ -81,14 +66,15 @@ sudo dpkg -l | grep php | tee ~/tempBackup/packages.txt sudo apt install php8.4-common php8.4-cli php8.4-fpm php8.4-{redis,bcmath,curl,dev,gd,igbinary,intl,mbstring,mysql,opcache,readline,xml,zip} ``` -**NGINX Configuration Update:** -1. Edit Nginx configuration file:: +### 2.3 NGINX Configuration Update + +#### **Edit Nginx configuration file:** ```bash sudo nano /etc/nginx/sites-available/default ``` -2. Update the `fastcgi_pass` directive to use the PHP 8.4 socket +#### **Update the `fastcgi_pass` directive to use the PHP 8.4 socket:** > **Note:** > Locate the line @@ -102,14 +88,16 @@ For example, to point to the PHP 8.4 FPM socket: ```nginx fastcgi_pass unix:/var/run/php/php8.4-fpm.sock; ``` + Save and exit the editor. -3. Test the Nginx configuration: +#### **Test the Nginx configuration:** + ```bash sudo nginx -t ``` -4. Restart Nginx and PHP-FPM, and Remove PHP 8.3: +#### **Restart Nginx and PHP-FPM, and Remove PHP 8.3:** ```bash sudo nginx -t @@ -120,17 +108,28 @@ sudo apt purge '^php8.3.*' php -v ``` -### 4.3 Update UNIT3D +## 3. Update UNIT3D ```bash cd /var/www/html php artisan git:update ``` +During the update process, UNIT3D differences all files and prompts the user to choose whether to keep the current version or update to the new one; typically, it is recommended to update all files, but before beginning the update, the most recent backup should be copied to `~/tempBackup`, and after the update, the list of file conflicts is saved as `~/tempBackup/fileConflicts.txt` so that, once the process is complete, these files can be reviewed to determine which changes should be merged or discarded. -### 4.4 Database Migration Fix +### 4. Database Migration Fix During the update, you might encounter an error related to the tickets table +```sql +2025_02_17_074140_update_columns_to_boolean ......................................................................................... 38.50ms FAIL + +In Connection.php line 825: + 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') + +In Connection.php line 571: + SQLSTATE[22004]: Null value not allowed: 1138 Invalid use of NULL value +``` + **Resolve NULL values in tickets table:** 1. Log in to MySQL: @@ -199,4 +198,4 @@ sudo php artisan set:all_cache && \ sudo systemctl restart php8.4-fpm && \ sudo php artisan queue:restart && \ sudo php artisan up -``` \ No newline at end of file +```