Data Back up and Restore

Data Back up and Restore

Patch Connect Plus stores data like configuration details, status of deployed configurations, and details about reports, like User Logon reports and Active Directory reports, in a database. Creating a backup of this database and certain important files like configuration files is necessary to prevent loss of data.

You can back up data automatically, by scheduling a back up using Patch Connect Plus, or taking a back up manually. You can also restore this data when required. For example, assume that your hard disk crashes and you have to re-install Patch Connect Plus. You can use the last back up you took to restore all the required information. Note that this is possible only if the backup file is stored in a computer other than yours.

Note:

This Data Backup and Restore is applicable only for Patch Connect Plus build 90094 or above.

Best practices for Back up and restore

These are the few best practices recommended for Back Up and Restore option.

  1. Ensure that you add the exclusion list for Antivirus. When directories containing the PGSQL data are scanned by Antivirus software, they misidentify the files content as spam and does not allow to back up that data. Refer the following links which will guide you, how to exclude the Antivirus.

    McAfee : https://kc.mcafee.com/corporate/index?page=content&id=KB50998

    Symantec : http://www.symantec.com/business/support/index?page=content&id=TECH99955

    Kaspersky : https://support.kaspersky.com/help/Kaspersky/Win21.5/en-US/227390.htm

  2. It is always recommended to schedule the back up during non-office hours.
  3. Ensure that you have a minimum of 5 GB space to store the back up data.
  4. Ensure that you specify a valid destination folder.
  5. Data Back Up

    Scheduling Data Backup

    You can use Patch Connect Plus to take a back up of the database regularly. For example, if you want to take a back up of the database every Friday at 5 p.m., you can schedule the same using Patch Connect Plus.

    To schedule back up of data, follow the steps given below:

    1. Select the Admin tab.
    2. In the Database settings section, click Database Backup.
    3. Specify the time at which you want the back up to be taken, in hour:minute:second (hh:mm:ss) format.

      Note:The database backup will happen every 24 hours and the time should be specified in the 24-hour format. For example, if you want the database back up to be taken at 6 p.m., the time should be specified as 18:00:00.

    4. Select the number of backup files that you want Patch Connect Plus to save.

      Note: Using this option you can select how many database backup files should be saved. The older backup files will be deleted. For example, if you want only 7 backup files saved, select 7. This will ensure that at all times only 7 backup files are saved.

    5. Specify the location where you want the backup files to be stored.
    6. Check the Notify when the database backup fails checkbox.
    7. Specify the email address (es) to which you want an e-mail message sent, if the database backup fails note that you should have configured your mail server settings to get notified.

      Note: Ensure that you have configured your mail server settings to receive notifications.

    8. Click Save Changes.
    9. You have scheduled an automatic data backup to take place at a specified time.

      Steps involved in creating manual data backup

      1. Stop the Patch Connect Plus service.
      2. Right click Start -->Explore --> directory where PCP server folder is present -->bin. For example, right click Start -->Explore -->Local Disk (C:) -->Program Files -->ManageEngine -->PatchConnectPlus -->bin.
      3. Run this bat in admin mode backupDB.bat

      Backup File is created in below location \PatchConnectPlus\Backup

      how-to-1

      How to restore a backup file

      1. Stop the Patch Connect Plus service.
      2. Right click Start -->Explore --> directory where PCP server folder is present -->bin. For example, right click Start -->Explore -->Local Disk (C:) -->Program Files -->ManageEngine -->PatchConnectPlus -->bin.
      3. Run this bat in admin mode restoreDB.bat. For example, restoreDB.bat "C:\Program Files\ManageEngine\PatchConnectPlus\Backup\OfflineBackup_20210223104852.ezip" -p ""

      how-to-1

      VM Back up

      In case you are using Endpoint Central in bundled PGSQL DB, you can restore Endpoint Central with the server machine via VM snapshot and start the server. Even then, Endpoint Central's scheduled backup is the primary backup and cannot be stopped.

      Note: If you are using MSSQL or remote PGSQL you should not use this VM restore as the database will be in another machine. If you do so, the server will not start due to data inconsistency.

      MSSQL BAK Backup

      Follow the steps below to grant the necessary permissions for MSSQL BAK backup: 

      1. Database permissions
        1. "CREATE ANY DATABASE"
          • This access is required in order to restore databases. For further information, please refer this Microsoft document.
          • Microsoft suggests executing the following query to grant this access.  Run these queries as a super admin:
            "Use master;
            GRANT CREATE ANY DATABASE TO user_name;
            GO" 
            Example
            Use master;
            GRANT CREATE ANY DATABASE TO dcuser;
            GO
          • This CREATE ANY DATABASE privilege allows the user to create a database and the user has authorization over only the databases created by it and if they are db_owner of the database.
          • An alternative would be to provide user with db_creator role but that user will a have access to alter any database.
        2. "db_owner"
          • This permission is required to backup and restore an already existing database.  Kindly refer to this Microsoft document to know more.
          • Microsoft suggests executing the following query to grant this access.  Run these queries as a super admin: 
            "Use master;
            ALTER AUTHORIZATION ON DATABASE::database_name TO user_name;
            GO" 
          • Example : 
                Use master
                ALTER AUTHORIZATION ON DATABASE::patchconnectplus TO pcpuser;
                GO
          • This permission gives db_owner access to the user.
      1. Folder Permissions

        Follow the procedures below to grant write permission to the ScheduledDBBackup folder in the sql server's application server installation location. 
        Note: We can provide permissions to a particular user or computer only when both the machines are in the same domain.
        1. Open the application server installation directory.
        2. For example, right click Start -->Explore -->Local Disk (C:) -->Program Files -->ManageEngine -->PatchConnectPlus.
        3. Right click on ScheduledDBBackup.
        4. Navigate to the Security tab, click Edit to change permissions and click add
        5. Click on Object types and check computers on and click OK
        6. Click on Locations, choose Entire Directory and click OK
        7. Enter the object names, the SQL Server Service logon user if it is a user or the machine name if the logon user is not an actual user eg: SYSTEM or NT Service\SQLSERVER. Click on CheckNames.
        8. Select the required objects and click OK.
        9. Click OK to navigate to the Permissions for ScheduledDBBackup window.
        10. Choose the respective users or computers added before and grant access for full control and modify. 
        11. Click apply and then OK.
        12. In the scheduleDBBackup properties window, navigate to the sharing tab and click Share under Network File and Folder Sharing.
        13. Choose the respective users or computers and provide write access and click Share.
        14. Ensure the share path is host-name/ScheduledDBBackup and click Done and Close.