Update to a new version
Updates come as a new version of the package. Read its entry in the Changelog first: it says whether the version needs a new app build, has database changes, or adds settings.
Before you start
- Back up the database (
mysqldump niceserve > niceserve-backup.sql) and thebackend/.envfile. - Back up uploads in
backend/storage/app/if you store files on the server. - If you changed the code, keep your changes in Git so you can merge the new version into them instead of overwriting them.
Update the backend and admin panel
Without SSH (shared hosting): on your computer, run composer install --no-dev --optimize-autoloader in the new backend/ folder, upload its files (with vendor/) over the old ones, keeping your .env and storage/ folder, then open https://your-domain/update, sign in with a super admin account and click Update now. It runs the database updates, clears the caches and restarts the queue.
With SSH:
cd /var/www/niceserve/backend
php artisan down # shows a maintenance page
# replace the code with the new version (git pull, or upload the new files
# without overwriting .env and storage/)
composer install --no-dev --optimize-autoloader
php artisan migrate --force
php artisan optimize
cd ../admin && npm ci && npm run build # or upload a build made on your computer
cd ../backend
php artisan queue:restart # workers pick up the new code
php artisan up
Never run migrate:fresh or db:seed on a live server: they delete or reset data.
If you run Reverb, restart it too: php artisan reverb:restart.
Update the app
If the changelog lists app changes:
- Merge the new
mobile/folder into your copy. Keep yourrebrand.yaml,android/key.properties, signing key and Firebase files. - Run the rebrand script again so the new code gets your name, IDs and icons:
dart run tool/rebrand.dart --config rebrand.yaml. - Raise the version in
mobile/pubspec.yaml(for example1.2.0+12: the number after+must go up with every store upload). - Build and upload to the stores as in Build and publish the app.
Update the backend first, then publish the app. Not everyone installs app updates right away, so check the changelog for changes that need both at once.