Update, backup and restore
Back up first, then update. This page shows how to do both, how to restore if something goes wrong, and how the demo reset command works.
Tip: The easiest way is built in: Settings → System & demo → Backups makes one ZIP with the database and pictures, makes one every night, and restores it in a few clicks. See Backup and restore. The manual methods below (phpMyAdmin, mysqldump) still work and are useful for the hosting company.
What to back up
A POSMaster shop has two things that matter:
| What | Where it lives |
|---|---|
| Your data (products, sales, customers, settings) | The database |
| Your pictures (logo, product photos) | The folder storage/app/public |
| Your settings file | The file .env (it holds your database password and APP_KEY) |
The rest of the app (the code) can always be downloaded again.
Warning: A backup that is stored only on the same server is not a real backup. Keep a copy on your own computer or in cloud storage.
Back up the database
With phpMyAdmin (no terminal)
- Open phpMyAdmin and select your POSMaster database.
- Click the Export tab.
- Choose Quick and the format SQL.
- Click Export. Your browser saves a
.sqlfile. - Rename the file with today's date, for example
posmaster-2026-10-19.sql, and keep it safe.
Tip: If you choose Custom instead of Quick, keep Add DROP TABLE ticked. It makes restoring into a used database easier.
With mysqldump (terminal)
mysqldump -u DB_USER -p DB_NAME > posmaster-backup.sql
Type the database password when it asks. For MariaDB you can also use mariadb-dump. For Docker, see Install with Docker.
To compress the file on Linux:
mysqldump -u DB_USER -p DB_NAME | gzip > posmaster-$(date +%F).sql.gz
Back up the pictures and settings
Copy these two items to a safe place:
- the folder
storage/app/public - the file
.env
On cPanel, use File Manager: select the folder, click Compress, and download the ZIP. Or use FTP. On a VPS:
cd /var/www/posmaster
tar -czf posmaster-files-$(date +%F).tar.gz storage/app/public .env
A simple backup plan
- Back up the database every day if you sell every day.
- Back up the pictures every week, or whenever you add many products.
- Keep at least the last 7 daily copies.
- Test a restore once, on a spare database, so you know it works.
Many hosts have automatic backups. cPanel has Backup and JetBackup. Use them too, but still take your own copy before every update.
Update to a new version
Follow these steps for every new release. Read CHANGELOG.md in the package first. It lists what changed.
- Back up the database,
storage/app/publicand.env. - Put the shop in maintenance mode (terminal only):
php artisan down
-
Replace the files. Upload the new
laravel-projectcontents over the old app folder. Replace everything except:.env(your settings)storage/app/public(your pictures)storage/logs(optional, your old logs)
Include the new
vendorfolder,public/buildandbootstrap. -
Install dependencies (only if your new package has no
vendorfolder):
composer install --no-dev -o
- Update the database:
php artisan migrate --force
- Clear and rebuild the cache:
php artisan optimize:clear
php artisan optimize
- Bring the shop back:
php artisan up
- Sign in, open the POS and make a test sale to check that everything works.
Warning: Never run
php artisan pos:install --demo,migrate:freshorpos:demo-resetto update a live shop. They erase the database.
Note: Do not delete the
public/storagelink or thestoragefolder when you replace files. Without them your pictures disappear. If the link is missing afterwards, runphp artisan storage:link.
Updating without a terminal
Some releases change the database, and the change is applied by php artisan migrate --force. If you have no terminal:
- Ask your host's support to run
php artisan migrate --forcein your app folder, or - Ask them to give you SSH access for a few minutes.
If you cannot run any command, upload the files and then delete the cached files inside bootstrap/cache (for example config.php and routes-v7.php; keep the folder and the .gitignore file) so the app does not keep using the old cache. Check CHANGELOG.md to see whether the release changes the database.
Updating Docker installs
Docker updates use a different procedure: rebuild the image and run the migrations inside the container. See Install with Docker.
Restore a backup
Use this if an update goes wrong, or you moved to a new server.
Restore the database
With phpMyAdmin:
- Select the database. If you want to start from scratch, tick Check all under the table list and choose Drop to remove all tables.
- Click Import.
- Choose your
.sqlfile and click Import.
With the terminal:
mysql -u DB_USER -p DB_NAME < posmaster-backup.sql
Tip: If the file is too big for phpMyAdmin, use the terminal command, or ask your host to import it.
Restore the pictures and settings
- Copy the backed-up
storage/app/publicfolder back into the app'sstorage/app/public. - Put your
.envfile back into the app folder. - Make sure
public/storageexists. If not, runphp artisan storage:link. - Clear the cache:
php artisan optimize:clear
Restore the app to an older version
If a new version has a problem, put the old files back, restore the database backup you took before the update, and clear the cache. Do not put old files over a database that has already been migrated by a newer version without restoring the database too.
Reset the demo data
The command pos:demo-reset wipes the database and loads the demo shop again. It is made for public demo servers.
php artisan pos:demo-reset
What it does:
- Deletes the pictures that visitors uploaded (products, categories and settings folders).
- Rebuilds every table and loads the demo shop with 90 days of sales.
It refuses to run while demo mode is off, so you cannot erase a live shop by mistake:
Demo mode is OFF — refusing to wipe a live database. Use --force if you really mean it.
Warning: Adding
--forcemakes it wipe the database even when demo mode is off. Never use--forceon a shop with real data.
To reset the demo every night at midnight, set POS_DEMO_RESET_NIGHTLY=true in .env and add the cron job described in Install on web hosting. For a locked public demo, also set POS_DEMO_LOCK=true.