Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
|
927427f512 | |
|
ba2ca333e7 |
|
@ -4,90 +4,73 @@ 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 release’s 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]:
|
3.2 Run new migrations
|
||||||
> yes
|
|
||||||
|
3.3 Install new packages
|
||||||
|
|
||||||
|
3.4
|
||||||
|
|
||||||
|
## 4. Resume Site Functionality
|
||||||
|
|
||||||
|
On a successful update process; clear the cache, restart the PHP-FPM service, restart the Laravel queues, and finally bring the site live.
|
||||||
|
|
||||||
|
```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.
|
||||||
|
|
||||||
2. **Accept upstream files:**
|
```sh
|
||||||
|
sudo supervisorctl reread && \
|
||||||
When prompted for each changed file, type `yes` to overwrite the local copy or press `Enter` to accept the default shown in brackets.
|
sudo supervisorctl update && \
|
||||||
|
sudo supervisorctl reload
|
||||||
```bash
|
|
||||||
Update config/unit3d.php (yes/no) [yes]:
|
|
||||||
> yes
|
|
||||||
|
|
||||||
git checkout origin/master -- config/unit3d.php
|
|
||||||
[============================] (Done!)
|
|
||||||
```
|
```
|
||||||
|
---
|
||||||
|
|
||||||
3. **Run new migrations:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
Run new migrations (php artisan migrate) (yes/no) [yes]:
|
|
||||||
> yes
|
|
||||||
```
|
|
||||||
|
|
||||||
4. **Install new packages:**
|
|
||||||
|
|
||||||
```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
|
|
||||||
composer install --prefer-dist --no-dev -o
|
|
||||||
```
|
|
||||||
|
|
||||||
- **Clear caches:**
|
|
||||||
|
|
||||||
|
Clear caches:
|
||||||
```sh
|
```sh
|
||||||
sudo php artisan cache:clear && \
|
sudo php artisan cache:clear && \
|
||||||
sudo php artisan queue:clear && \
|
sudo php artisan queue:clear && \
|
||||||
|
@ -95,22 +78,20 @@ The following commands are **optional** and should be run only as needed to reso
|
||||||
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`
|
||||||
|
|
||||||
- **Rebuild static assets:**
|
Restart the PHP-FPM service:
|
||||||
|
`sudo systemctl restart php8.4-fpm`
|
||||||
|
|
||||||
```sh
|
Restart the Laravel queues:
|
||||||
sudo bun install && sudo bun run build
|
`sudo php artisan queue:restart`
|
||||||
```
|
|
||||||
|
|
||||||
- **Restart services:**
|
Bring the site live:
|
||||||
|
`sudo php artisan up`
|
||||||
|
|
||||||
```sh
|
> [!TIP]
|
||||||
sudo systemctl restart php8.4-fpm && \
|
> If running external Unit3d-Announce, restart the supervisor services.
|
||||||
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