Software AG Products 10.11 | Administrating API Gateway | Operating API Gateway | Data Management | Data Backup | Data Store Backup | Creating API Data Store Backup
 
Creating API Data Store Backup
After you have configured the backup repositories, you can create backups.
Pre-requisites:
*Ensure that you have the API Gateway running during backup.
*Ensure that you configure a repository to store your backup files. For information about creating and configuring a repository, see Configuring a Backup Repository.
*To take backup
1. From the command prompt, go to SAGInstallDir/IntegrationServer/instances/default/packages/WmAPIGateway/cli/bin.
Note:
Replace default with the corresponding instance name.
2. Run the following command to create a backup in the default location:
Linux
./apigatewayUtil.sh create backup
Windows
apigatewayUtil.bat create backup
The following sample shows the creation of a backup on Windows. The backup is created in the default location, SAGInstallDir/InternalDataStore/archives/.
C:\SoftwareAG\IntegrationServer\instances\default\packages\WmAPIGateway\cli\bin>apigatewayUtil.bat create backup

Initiated backup process for default-2021-may-17-22-23-2-266000000 file
You can include the following parameters to customize the backup as per your requirements.
Parameter
Description
name
Name of the backup file. You can provide alphanumeric values and the following special characters: !, @, $, % , ( , ). The name can be based on date and time for unique identification.
If you do not provide any name for the backup file, the script generates a name with the current time and the value provided for the tenant parameter. For example, default-2021-may-17-22-23-2-266000000.
Note:
Do not use uppercase in the name.
tenant
Name of the tenant in which the data exists.
If you do not provide this parameter, the value is picked from pg.gateway.elasticsearch.tenantId property in config.properties file located at IntegrationServer\instances\instance_name\packages\WmAPIGateway\config\resources\elasticsearch.
repoName
Name of the repository where the backup must be saved. If you do not specify this value, then the backup is stored in the default location.
If you do not provide this parameter, the value is picked from the tenant parameter.
include
Type of data you want to include in the backup file. All indexes, irrespective of their types, are included in the backup file if you do not provide any parameters.
Available options for this parameter are:
*Assets. To include all API Gateway assets in the backup being created.
*Audit. To include the audit data in the backup.
*Analytics.To include analytics data in the backup.
*License. To include the license data in the backup. This data provides the transaction usage analytics across all stages of the application.
*Log. To include log data in the backup. The log index stores the application logs when log aggregation is enabled in API Gateway. It stores logs at Integration Server level, API Data Store level, and platform level.
If you include one or more of the above entries in your backup, the corresponding item is added as a suffix to your backup file name. That is, if you provide include assets audit parameter in your backup command, and if your backup name is backup01, then the backup file name is created as backup01 -assets audit.
If you have different retention period for core data and analytics data, then you can use this parameter to create backup of a particular type of data. For example, if you have an RPO of 30 mins for core data and 4 hours for all data (including analytics), then you run the following command for every 30 mins and the full backup command every 4 hours:
apigatewayUtil.bat create backup
-tenant mytenant
-name mytenant_2021June031230
-include assets -repoName myrepo
The names of indexes that you can provide with this parameter for the above data types are listed in the section, List of Indexes that can be included in backup.
debug
Option to specify whether you want to activate debugging when creating a backup. Available levels are:
*true. Displays detailed information on the backup process when the script is run. In most cases, the output printed with the debug parameter is helpful to troubleshoot the issue.
*false. Does not display detailed information. The value is considered as false, when this parameter is not provided.
logLevel
Level of log that you want to create. Log levels indicate the severity of logs. Available levels are:
*Info. Provides the list of regular events that occur during the process. These events are informative.
*Debug. Provides the events that could be useful, if you have to debug the process.
*Warning. Indicates unexpected events that occurred during the process. Usually, these events do not interrupt or have an immediate effect on the process.
*Error. Indicates the events that stop the functionality from working as designed.
*Trace. Provides the list of events in a much detailed manner that could be useful for debugging.
You can specify one of the log level with the logLevel parameter. For example, to create a log file of Warning level when listing backup files, you can run the following command:
apigatewayUtil.bat list backup -logLevel warning
When you provide Error as the log level, then only the error level logs are saved. When you provide Debug as the log level, then Debug, Info, Warning and Error level logs are saved. When you provide Trace as log level, then all level logs are saved.
This parameter is optional. If you do not specify the parameter, then the Info level logs are saved by default.
logFileLocation
Location where you want to save the log file.
For example, to save the log file in C:/apiglogs/backups, you can provide the location as seen in the following example:
apigatewayUtil.bat create backup -name samplebackup
-logFileLocation C:/apiglogs/backups
This parameter is optional. If you do not specify the parameter, the logs are saved in the following location SAGInstallDir/IntegrationServer/instances/instance_name/packages/WmAPIGateway/cli/logs/APIGWUtility.log.
The parameters listed above are optional. To create a backup file in the repository that you configured, use the repoName parameter to provide the repository name. That is,
apigatewayUtil.bat create backup -repoName repository_name
For example,
apigatewayUtil.bat create backup -repoName s3_repo
After running the script, you can check the backup status using the status backup command and view the list of backup files in your repository. For information on verifying backup status, see Verifying Backup Status and for information on viewing the list of backup files, see Viewing Backup Files List.
Important:
From the Data housekeeping perspective, Software AG recommends that you schedule the execution of these commands through cron jobs or other scheduling options. The frequency of the backup depends on your RPO needs.