SAFR Server Backup and Restore

The backup process backs up and restores the entire SAFR Server, including the various databases, configuration files, images, and objects.

On Windows

Backup

To use the Windows Task Scheduler to create a daily database backup, do the following:

  1. Run the Windows Task Scheduler as an administrator. The Task Scheduler window will be displayed.

  2. In the Actions pane, click Create Basic Task.

  3. In the wizard’s Name field, provide a name for the task. (e.g. SAFR DB Daily Backup) Click Next.

  4. Under Task Trigger, select the Daily option, and click Next.

  5. Set the date and time for when you want the task to run, and enter 1 in the Recur field. Click Next.

  6. Using a text editor, create a .bat file called SAFR DB Daily Backup. Edit the .bat file, add the following commands, and thensave the file.

    @echo off
    cd C:\Program Files\RealNetworks\SAFR\bin
    start python backup.py
  7. Under Action, select the Start a Program option, and click Next.

  8. Click Browse and select the SAFR DB Daily Backup.bat file you created in Step 6. Click Next.

  9. Under Summary, select Open the Properties dialog for this task when I click Finish, and click Finish.

  10. In Properties, do the following:

    1. Select the Run whether user is logged on or not option.

    2. Select the Run with highest privileges option.

    3. Click Change User or Groups.

    4. Enter the object name to select in the field. (e.g. DB-USERMACHINE-T/username) Click Check Name and click OK.

    5. Enter your username and password and click OK.

Once this procedure is completed, you can find the task in the Task Scheduler Library. Check History to view the task events. You can find the daily backup file in the path shown in the SAFR DB Daily Backup.bat file.

Restore

command path: C:\Program Files\RealNetworks\SAFR\bin

run command: python restore.py BACKUPFILENAME

Press Y when asked, “Are you sure? (Yy/Nn)”

You’ll receive the following message when the restore is complete:

On Linux

Backup

command path: /opt/RealNetworks/SAFR/bin

run command: sudo python backup.py

The backup command generates a backup file at the path /opt/RealNetworks/SAFR/backups/SAFR-backup-YYYYMMDD-HHMMSS.tgz

You’ll receive the following message when the backup is complete:

Restore

command path: /opt/RealNetworks/SAFR/bin

run command: sudo python restore.py BACKUPFILENAME

Press Y when asked, “Are you sure? (Yy/Nn)”

Auto Daily Backup

Script:

#backup at 1 a.m every day
0 1 * * * /bin/sh /opt/RealNetworks/SAFR/bin/backup
# remove 7 days before backup files at each sunday 0:30 a.m
30 0 * * 0 find /opt/RealNetworks/SAFR/backups/ -mtime +3 -name "*.tgz" -exec rm -rf {} \;

Result:

root@SAFRDemo:/opt/RealNetworks/SAFR/backups# ls -l
total 6547396
-rw-r----- 1 safr safr 837380012 Sep 11 01:00 SAFR-backup-20190911-010001.tgz
-rw-r----- 1 safr safr 837423761 Sep 12 01:00 SAFR-backup-20190912-010001.tgz
-rw-r----- 1 safr safr 837443430 Sep 13 01:00 SAFR-backup-20190913-010001.tgz
-rw-r----- 1 safr safr 837450675 Sep 14 01:00 SAFR-backup-20190914-010001.tgz
-rw-r----- 1 safr safr 837588424 Sep 15 01:00 SAFR-backup-20190915-010001.tgz
-rw-r----- 1 safr safr 837587472 Sep 16 01:00 SAFR-backup-20190916-010001.tgz
-rw-r----- 1 safr safr 839439035 Sep 17 01:00 SAFR-backup-20190917-010001.tgz

On macOS

Backup

command path: /Library/RealNetworks/SAFR/bin

run command: sudo python backup.py

The backup command generates a backup file at the path /opt/RealNetworks/SAFR/backups/SAFR-backup-YYYYMMDD-HHMMSS.tgz

You’ll receive the following message when the backup is complete:

Restore

command path: /Library/RealNetworks/SAFR/bin

run command: sudo python restore.py BACKUPFILENAME

Press Y when asked, “Are you sure? (Yy/Nn)”

You’ll receive the following message when the restore is complete:

See Also