UltimatePOS

  1. Home
  2. Docs
  3. UltimatePOS
  4. Enabling Backups (Backup in Server, AWS S3)

Enabling Backups (Backup in Server, AWS S3)

By default, backup is not enabled for every user of the POS application. To enable backup follow these steps:

  1. IMPORTANT: For the backup to work ziparchive must be enabled in the server PHP
  2. 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)
  3. 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.
  4. You can enable AWS S3 or other servers as per the instruction below.
  5.  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 AWS s3  is supported out-of-box with UltimatePOS.

Enabling Backup to Store in AWS S3:

Step 1: Create a Bucket

Follow the steps mentioned in the article below for creating a bucket

https://aws.plainenglish.io/how-to-create-amazon-s3-bucket-443596cce3fc

Step 2: Add Bucket Details in the .env file

  1. Open .env file. [In your codebase there is a file named .env, open it in edit mode]
  2. Set the key BACKUP_DISK=”s3″
  3. Also, add the below keys:
    1. AWS_KEY=””
    2. AWS_SECRET=””
    3. AWS_DEFAULT_REGION=””
    4. AWS_BUCKET=””

Backup for localhost, windows operating system:

Follow these steps:

  1. 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’]
  2. PATH TO MYSQL DUMP = Replace it with the exact path of MySQL Dump binary
    For example: c:/xampp/mysql/bin/
  3. Try taking a backup now.

If it shows undefined package zip follow these steps to install php_zip package:

  1. Go to https://pecl.php.net/package/zip and download the most recent release of the extension.
  2. 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 
  3. Edit the php.ini file and add a new line extension=php_zip.dll and restart the Apache server.

Backup Path:

Backups are stored inside public/uploads/ultimatepos

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.

https://laravel.com/docs/9.x/scheduling#schedule-frequency-options

Clear Backup:

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 .

pos\app\Console\Kernel.php

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.

Problem 1:

Enable proc_open in your server. Contact your hosting provider to enable it.

Storage Usage:

  1. For Local server = Storage will be used for the server where POS is installed
  2. For AWS S3= Storage of AWS S3 will be used

NOTE: For some technical issues, the Dropbox backup support is removed.

Restore Backup:

The backup file created by UltimatePOS includes the following items:

  • Database backup
  • All public/uploads backup
  • .env file
  • Custom views files (if added)

To restore the backup, please follow these simple steps:

Step 1: Download the code files from your POS account.

Step 2: Upload the files to your domain and proceed to install UltimatePOS.

Step 3: After the installation, replace the current database with the one provided in the backup (filename.sql).

Step 4: Similarly, replace the other files in the code directory with the ones available in the backup.

Step 5: Lastly, follow the update steps outlined in the Update Guide – Update_Guide_Link


📩 Still stuck? Contact Support

Was this article helpful to you? Yes 6 No 15