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.
- 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
- It is always recommended to schedule the back up during non-office hours.
- Ensure that you have a minimum of 5 GB space to store the back up data.
- Ensure that you specify a valid destination folder.
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:
- Select the Admin tab.
- In the Database settings section, click Database Backup.
- 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.
- 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.
- Specify the location where you want the backup files to be stored.
- Check the Notify when the database backup fails checkbox.
- 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.
- Click Save Changes.
You have scheduled an automatic data backup to take place at a specified time.
Steps involved in creating manual data backup
- Stop the Patch Connect Plus service.
- 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.
- Run this bat in admin mode backupDB.bat
Backup File is created in below location
\PatchConnectPlus\Backup
How to restore a backup file
- Stop the Patch Connect Plus service.
- 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.
- Run this bat in admin mode restoreDB.bat. For example, restoreDB.bat "C:\Program Files\ManageEngine\PatchConnectPlus\Backup\OfflineBackup_20210223104852.ezip" -p ""
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:
- Database permissions
- "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.
- "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.
- 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.
- Open the application server installation directory.
- For example, right click Start -->Explore -->Local Disk (C:) -->Program Files -->ManageEngine -->PatchConnectPlus.
- Right click on ScheduledDBBackup.
- Navigate to the Security tab, click Edit to change permissions and click add.
- Click on Object types and check computers on and click OK.
- Click on Locations, choose Entire Directory and click OK.
- 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.
- Select the required objects and click OK.
- Click OK to navigate to the Permissions for ScheduledDBBackup window.
- Choose the respective users or computers added before and grant access for full control and modify.
- Click apply and then OK.
- In the scheduleDBBackup properties window, navigate to the sharing tab and click Share under Network File and Folder Sharing.
- Choose the respective users or computers and provide write access and click Share.
- Ensure the share path is host-name/ScheduledDBBackup and click Done and Close.