Technical FAQs

Ask a Question

Changing Database Backup Location in PME 7.2/8.x

Issue
The default location of database backup is ...\config\cfg\DBBackups\ folder.  In some cases the backup location has to be moved to a different drive due to storage space or company policy.

Product Line
Power Monitoring Expert 7.2/8.x

Environment
Windows PowerShell script file.

Related Articles
FA230476: Basic PowerShell Commands
FA230577: Database Scheduled Task Files and Supporting Files

Cause
The parameter $locationForBackupFiles in Configuration.ps1 file is the location where the database backups are stored.  By default this parameter is set to:
     $locationForBackupFiles = "cfg\DBBackups\"
Meaning the backup jobs will save the database backups to the 'config\cfg\DBBackups\' found in the installation folder.

There are two ways of choosing where to save the backups:
1 - Full Path
This means that a full, rooted path is entered.  Examples of full or rooted paths are:
     "C:\Program Files\SomeFolder\"
     "D:\Data\Backups\"
     \\NetworkFolder\MyFiles

2 - Relative (non-rooted) Path
This means that you want the backups to be saved to a folder within the installation folder, and under Config folder.  Examples of relative paths are:
     "MyFolder\Backups\Databases\"
     "backups\"

The main characteristic of a relative (non-rooted) path is the lack of \ or \\ or drive letter at the start of the path.

Resolution
*Warning: Take backups of any files prior to modifying them. Ensure the backups are in a location 
that will not be overwritten (i.e. the Desktop).

To change the location where the backup scheduled jobs save the backup files to, simply modify the setting 'locationForBackupFiles' to the new path.  Example for each case:

1 - Full Path
     $locationForBackupFiles = "D:\Backups\

                   


2 - Relative (non-rooted) Path
     $locationForBackupFiles = "DB Backups"

                    

Note that in both cases, new subfolders are created and named based on the database.

 
IMPORTANT
The IONMaintenance user must be granted read\write permissions to the destination folder.  If the location is the default PME installation folder, this step is not necessary.
The IONMaintenance user or a group that the IONMaintenance user is a member of must be added to the "Log on as batch job" user right assignment in the local security policies.

  1. In Windows Explorer, highlighted the new backup directory you just created: right-click > properties, choose the 'Security' tab

     
  2. Click 'Edit' > 'Add' and the 'Select Users or Groups' window will open. Type 'IONMaintenance' > click 'OK'

     
  3. Highlight the 'IONMaintenance' user and check 'read' and 'write' permissions. Click Apply > click OK.
     
     
  4. Click 'OK' to leave the Security window. Click OK to close the 'Properties' window.
Was this helpful?
What can we do to improve the information ?