Update to v7.3.0
How to update from v7.2.x to v7.3.0. It is an update inside v7, but v7.3 is the one version that composer update alone does not reach.
v7.3 moves the library of the admin screens, "exceedone/exment-admin-core", from 1.x to 2.x. The composer.json of a site so far fixes admin-core to ^1.0, so a plain composer update says "Nothing to install, update or remove" and the site stays on v7.2.x.
| v7.2.x | v7.3.0 | |
|---|---|---|
| PHP | 8.2 or later | 8.2 or later (no change) |
| exceedone/exment-admin-core | 1.x (^1.0) | 2.x (^2.1) |
| QR code library | simplesoftwareio/simple-qrcode | bacon/bacon-qr-code 3.x |
| Laravel | 12 | 12 (no change) |
| MySQL / MariaDB | 8.0 or later / 10.11 or later | no change |
If you get an error, see Troubleshooting.
1. Take a backup
Always take a backup before the update.
- Back up the database and the whole folder of Exment (with
composer.json,composer.lock,vendor,public/vendor,.envandstorage). - Check with your own eyes that the backup file is there.
php artisan exment:backupcan end without an error even when mysqldump failed (for example with a self-signed TLS certificate of the database).
2. A site installed with composer
In the folder where Exment is installed (the root of the project), run these in order.
# 1. exment and exment-admin-core of 7.3 (-W is needed)
composer require "exceedone/exment:^7.3" "exceedone/exment-admin-core:^2.1" -W
# 2. update the database and the rest
php artisan exment:update- 1.
simplesoftwareio/simple-qrcodein thecomposer.jsonof a site installed from the v7.2 zip or boilerplate (v7.3 does not use it) is removed automatically by this line. There is no need to remove it first. - 1. Add
-W(--with-all-dependencies). Without it, it stops with a message like "bacon … fixed to 1.0.2 by a partial update". It brings exment 7.3, exment-admin-core 2.1.1 or later and bacon/bacon-qr-code 3.x (and adds dasprid/enum).- If the site itself requires
bacon/bacon-qr-code1.x, add"bacon/bacon-qr-code:^3"to the same line.
- If the site itself requires
- 2. On a production site (
APP_ENV=production), answer yes when it asks for a confirmation (to go on without being asked, add--force). - A site whose
composer.jsonlists neither exment-admin-core nor simple-qrcode (onlyexceedone/exment) updates with a plaincomposer updateandphp artisan exment:update. - At the end, press Ctrl+F5 (super reload) in the browser.
3. A site installed from the zip, a rental server
Replace it with the v7.3 zip.
php artisan down(maintenance mode).- Take the backup above.
- Rename the folder (for example
exment→exment_old). - Download the v7.3 zip and unpack it as a folder with the old name.
- Delete
storagein the new folder, and copy the wholestorageand.envfrom the old folder. - Delete
bootstrap/cache/*.phpin the new folder. - Run
php artisan exment:update --force. php artisan up(end of maintenance mode).
| What to do | |
|---|---|
.env, all of storage (app/admin, app/plugins, app/backup, app/templates, oauth-*.key and so on) | Use the old ones as they are |
Files you put or changed in public, edits by hand in config/*.php, packages you required with composer yourself (ldaprecord and so on) | Bring back by hand, looking at the old folder |
Your own code in app/Exment/bootstrap.php | Bring back by hand (exment:update makes the file again) |
vendor, composer.json, composer.lock, public/vendor, bootstrap/cache | The new ones (do not use the old ones; exment:update makes public/vendor again) |
4. What changes in v7.3
Plugins and your own code: messages are shown as text
With admin-core 2.x, the messages of admin_info(), admin_success(), admin_warning(), admin_error() (and *_once()) and admin_toastr() are shown as text, not HTML. A < in a name or an error text is shown as it is, which is safe.
When a message uses HTML (<br>, a link and so on), wrap it in admin_html_message(), and wrap the values in it with e() (or esc_html()).
// up to v7.2
admin_info('Done', $name . ' was made.<br><a href="' . $url . '">Open</a>');
// from v7.3
admin_info('Done', admin_html_message(e($name) . ' was made.<br><a href="' . e($url) . '">Open</a>'));Without it, <br> and the like are shown as text (nothing stops working).
Feature management
Many of the features added in v7.3 are turned on or off in "System Setting" → "Feature management". Some new features start off.
Screens
In the left menu, an item with items under it opens to the side (the old way can be chosen in the system settings). See the release notes.
5. Exment SaaS
Exment SaaS is updated by its provider. You do not need these steps.
6. To go back
Go back to the backup taken before the update.
- Restore the database from the backup taken before.
- Put back
composer.json,composer.lock,vendorandpublic/vendorfrom before (a zip site: go back to the old folder you renamed). - Delete the content of
bootstrap/cacheand runphp artisan optimize:clear.
Do not use php artisan migrate:rollback. Some database changes of v7.3 have no step back, so menus and columns would remain.
