Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
|
927427f512 | |
|
ba2ca333e7 |
|
@ -4,116 +4,97 @@ Update UNIT3D to the latest version by reviewing the release notes and following
|
|||
|
||||
## 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]
|
||||
> Ensure there is a complete backup before proceeding.
|
||||
> [!IMPORTANT]
|
||||
> Ensure a complete backup is on hand before proceeding.
|
||||
|
||||
## 2. Enter Maintenance Mode
|
||||
|
||||
```bash
|
||||
```sh
|
||||
cd /var/www/html
|
||||
php artisan down
|
||||
```
|
||||
|
||||
## 3. Update UNIT3D
|
||||
|
||||
> [!NOTE]
|
||||
> Before running the update, review the new release’s minimum requirements to ensure the environment meets them.
|
||||
Proceed to update UNIT3D:
|
||||
|
||||
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
|
||||
cd /var/www/html
|
||||
php artisan git:update
|
||||
```
|
||||
```sh
|
||||
cd /var/www/html
|
||||
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
|
||||
```
|
||||
3.2 Run new migrations
|
||||
|
||||
2. **Accept upstream files:**
|
||||
3.3 Install new packages
|
||||
|
||||
When prompted for each changed file, type `yes` to overwrite the local copy or press `Enter` to accept the default shown in brackets.
|
||||
3.4
|
||||
|
||||
```bash
|
||||
Update config/unit3d.php (yes/no) [yes]:
|
||||
> yes
|
||||
## 4. Resume Site Functionality
|
||||
|
||||
git checkout origin/master -- config/unit3d.php
|
||||
[============================] (Done!)
|
||||
```
|
||||
On a successful update process; clear the cache, restart the PHP-FPM service, restart the Laravel queues, and finally bring the site live.
|
||||
|
||||
3. **Run new migrations:**
|
||||
```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.
|
||||
|
||||
```bash
|
||||
Run new migrations (php artisan migrate) (yes/no) [yes]:
|
||||
> yes
|
||||
```
|
||||
```sh
|
||||
sudo supervisorctl reread && \
|
||||
sudo supervisorctl update && \
|
||||
sudo supervisorctl reload
|
||||
```
|
||||
---
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
sudo php artisan migrate
|
||||
```
|
||||
Finish any migrations not completed:
|
||||
`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:
|
||||
```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
|
||||
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
|
||||
```
|
||||
Restart the Laravel queues:
|
||||
`sudo php artisan queue:restart`
|
||||
|
||||
- **Rebuild static assets:**
|
||||
Bring the site live:
|
||||
`sudo php artisan up`
|
||||
|
||||
```sh
|
||||
sudo bun install && sudo bun run build
|
||||
```
|
||||
> [!TIP]
|
||||
> If running external Unit3d-Announce, restart the supervisor services.
|
||||
|
||||
- **Restart services:**
|
||||
|
||||
```sh
|
||||
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
|
||||
sudo supervisorctl reread && \
|
||||
sudo supervisorctl update && \
|
||||
sudo supervisorctl reload
|
||||
```
|
||||
```sh
|
||||
sudo supervisorctl reread && \
|
||||
sudo supervisorctl update && \
|
||||
sudo supervisorctl reload
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue