By default, backup is not enabled for every user of the POS application. To enable backup follow these steps:
- IMPORTANT: For the backup to work ziparchive must be enabled in the server PHP
- Log in with superadmin user for which backup is enabled. Now it will show an “Administrator Backup” menu in the left navigation menu. (How to add a superadmin user)
- Go to Administrator Backup menu and click on “Create New Backup“. A backup will be created & stored in your server or store in the configured server.
- You can enable Dropbox or other servers as per the instruction below.
- Generated backup files contain the following i) Database backup ii) public/uploads folder.
NOTE: For backup to work mysqldump must be enabled in your server.
Storing Backup in the same server where you have the application hosted can be dangerous, imagine what will happen if the server crashes? the backup will be lost.
So it is always advisable to store the backup in some external drive. Luckily DropBox & Amazon S3 is supported out-of-box with UltimatePOS.
(Recommended) Enabling Backup to Store in DropBox:
Using superadmin module:
- Go to Superadmin -> Superadmin settings -> Backups
- Select Backup Disk: as dropbox
- Enter Dropbox Access Token:
Not using superadmin module:
- Open .env file.
- Change BACKUP_DISK=”local” to BACKUP_DISK=”dropbox”
- Add/Edit another key: DROPBOX_ACCESS_TOKEN=”token_key_here”
Getting dropbox access token:
- Open https://www.dropbox.com/developers/apps
- Choose an API: Scoped access
- Choose the type of access you need: App folder
- Name your app: pos_backup
- Click “Create App” button
- In next screen: Access token expiration as “No Expiration”.
- Go to the Permission tab (in dropbox) and select: account_info.read, files.metadata.write,files.metadata.read, files.content.write, files.content.read file_requests.write, file_requests.read and Submit. Refer the screenshot below.
- Make sure you have enabled the permissions and then generate an access token.
- Click “Generated access token“.
- Copy the shown access token and use it.
- use then generated access token as described above.
Enabling Backup to Store in AWS S3:
- Open .env file.
- Add (or Edit if already present) a key BACKUP_DISK=”s3″
- Also, add the below keys:
Backup for localhost, windows operating system:
Follow these steps:
- Add(copy and paste) the below lines of code to the file config/database.php below the line ‘engine’ => null, ‘dump’ => [ ‘dump_binary_path’ => ‘PATH TO MYSQL DUMP’]
- PATH TO MYSQL DUMP = Replace it with the exact path of MySQL Dump binary
For example: c:/xampp/mysql/bin/
- Try taking a backup now.
If it shows undefined package zip follow these steps to install php_zip package:
- Go to https://pecl.php.net/package/zip and download the most recent release of the extension.
- Extract the zip file named ‘php_zip.dll‘ inside the folder named as ‘ext‘. If you are using XAMPP this is the path – C:\xampp\php\ext
- Edit the php.ini file and add a new line extension=php_zip.dll and restart the Apache server.
Changing Cron job interval in code:
Follow the file path in the codebase pos\app\Console\Kernel.php
Search for the line twiceDaily(1, 13) and change it as per required.
Refer to the laravel official document below.
Add the cleanup cron command found in the Administer Backup page in your server.
This cron command will work every day between 11 to 12 pm.
It’ll keep only the last 7 days’ backup.
Inorder to change the time interval of the command to work follow the file path .
Search for the line twiceDaily(1, 13) and just two lines above this you will find the code to change the interval for the cleanup cron command.
Enable proc_open in your server. Contact your hosting provider to enable it.
- For Local server = Storage will be used for the server where POS is installed
- For Dropbox = Storage of dropbox will be used
📩 Still stuck? Contact Support