Update upating_unit3d_version.md
This commit is contained in:
parent
8749f03afc
commit
4913faf5e1
|
@ -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 release’s minimum requirements.
|
> **Tip:** Before running the update, review the new release’s 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
|
||||||
|
```
|
||||||
|
|
||||||

|
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]:
|
|
||||||
> yes
|
|
||||||
````
|
|
||||||
|
|
||||||
3. **Run new migrations**
|
|
||||||
```bash
|
|
||||||
php artisan migrate
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
3. **Run new migrations:**
|
||||||
|
|
||||||
## 4. Resume Site Functionality
|
```sh
|
||||||
|
Run new migrations (php artisan migrate) (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.
|
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
|
```sh
|
||||||
sudo php artisan set:all_cache && \
|
sudo php artisan migrate
|
||||||
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.
|
- **Reinstall dependencies:**
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo supervisorctl reread && \
|
composer install --prefer-dist --no-dev -o
|
||||||
sudo supervisorctl update && \
|
|
||||||
sudo supervisorctl reload
|
|
||||||
```
|
```
|
||||||
---
|
|
||||||
|
|
||||||
|
- **Clear caches:**
|
||||||
|
|
||||||
## 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
|
```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 && \
|
||||||
|
|
Loading…
Reference in New Issue