Integrate Software AG Products Using Digital Event Services : API Gateway Configuration Guide : API Gateway Data Management : API Gateway Database Backup and Restore
API Gateway Database Backup and Restore
You can take regular backups of the internal database where API Gateway data is stored to protect against accidental data loss. You can take a backup of complete API Gateway data that includes analytics data and assets data or you can take a partial backup that includes the backup of assets data or backup of analytics data. When you take a backup, you copy the contents of the repository to a file or to a cloud storage. At a later stage, you can retrieve the contents of the backup and restore them to API Gateway.
Note:  
*API Gateway supports incremental backup. For example, if you have taken a backup of 50 GB and there is an increase in backup to 52 GB, API Gateway takes a backup of the new 2 GB data added.
*While performing a backup, the database experiences additional load, therefore, Software AG recommends taking a backup when the usage is low so as to avoid performance degradation.
*While restoring the backup from the repository, API Gateway replaces the existing data in API Gateway.
*API Gateway is not accessible when database restore is in progress.
To take a complete or partial backup of the API Gateway data and restore it to API Gateway, you can use the API Gateway command line utility. To back up and restore the database in command line, use the apigatewayUtil.bat and the apigatewayUtil.sh files available in the <Integration Server_directory>\instances\<instance_id>\packages\WmAPIGateway\cli\bin folder for Windows and UNIX systems respectively.
API Gateway supports the following storage platforms:
*Network File System (NFS)
*Amazon Simple Storage Service (S3)
Note:  
You must install the Amazon Web Services (AWS) cloud plugin if you want to use the Amazon S3 storage platform. To install the AWS cloud plugin, run the following command and restart Integration Server: <Integration Server_directory>\EventDataStore\bin\plugin install cloud-aws
Using NFS Storage Platform
API Gateway uses NFS as the default repository in which the backup is stored. You can configure the repositories in which the backup is stored either in NFS or S3 cloud. However, you can create a single repository and place all the backup files in that repository.
*Taking a backup:
By default, API Gateway stores the backup in the Integration Server_directory\EventDataStore\archives\ directory. For example, if you run the command, apigatewayUtil.bat create backup -name <backup_file_name>, to take a backup, the backup is saved the Integration Server_directory\EventDataStore\archives\default directory.
*Restoring a backup:
To restore the data taken as backup to API Gateway, run the following command: apigatewayUtil.bat restore backup -name <backup_file_name>
Note:  
Once the backup is restored, you must restart the API Gateway instance.
*Restoring backup to a new instance:
1. Copy the data from Integration Server_directory\EventDataStore\archives\ directory where the backup data is available.
2. Go to the Integration Server_directory\EventDataStore\archives\ directory where the backup data is to be restored and ensure that you delete any existing data in this directory.
3. Paste the data in the Integration Server_directory\EventDataStore\archives\ directory.
4. Run the following command to restore the data: apigatewayUtil.bat restore backup -name <backup_file_name>
Note:  
Once the backup is restored, you must restart the API Gateway instance.
*Specifying NFS Directory path:
For API Gateways in a clustered environment, you must specify a NFS directory path. This directory path is a shared file location, which must be accessible to all the API Gateway nodes in the cluster to take a backup and restore the backup files.
1. Configure the NFS directory path before creating the NFS repository in elastic search by running the following command: apigatewayUtil.bat configure fs_path -path c://sample//APIGATEWAY
2. Restart Integration Server to make the new NFS directory path available to store the backup, else the backup is stored in the default location.
Using S3 Storage Platform
You can save your backups to S3 cloud.
*Creating a repository:
1. To create a repository using S3, run the following command:
apigatewayUtil.bat configure manageRepo -file <file_path>
where <file_path> is the path where the S3 cloud details are specified.
For example, apigatewayUtil.bat configure manageRepo -file <Integration Server_directory>\instances\<instance_id>\packages\WmAPIGateway\cli\bin\conf\gateway-s3-repo.cnf.
2. Go to <Integration Server_directory>\instances\<instance_id>\packages\WmAPIGateway\cli\bin\conf.
3. Open the gateway-s3-repo.cnf file. The following information appears:
type=s3
bucket=<s3-bucket-name>
region=<s3-region>
accesskey=<s3-access-key>
secretkey=<s3-secret-key>
basepath=<s3-base-path>
Note:  
The supported regions are: US East (N. Virginia): us-east-1, US West (N. California): us-west-1, US West (Oregon): us-west-2, Asia Pacific (Seoul): ap-northeast-2, Asia Pacific (Singapore): ap-southeast-1, Asia Pacific (Sydney): ap-southeast-2, Asia Pacific (Tokyo): ap-northeast-1, EU (Frankfurt): eu-central-1, EU (Ireland): eu-west-1.
4. Configure the S3 details in the gateway-s3-repo.cnf file, for example,
bucket=apigateway-store
region=us-west-1
accesskey=123-test-123d-123
secretkey=tests1232sk12312t
After modifying the gateway-s3-repo.cnf file, run the following command: apigatewayUtil.bat configure manageRepo -file <file_path>
For example, apigatewayUtil.bat configure manageRepo -file <Integration Server_directory>\instances\<instance_id>\packages\WmAPIGateway\cli\bin\conf\gateway-s3-repo.cnf
*Taking a backup:
To take a backup of the data, run the following command: apigatewayUtil.bat create backup -name <backup_file_name>
Note:  
The <backup_file_name> must be specified in lowercase.
*Restoring a backup:
To restore the data taken as backup to API Gateway, run the following command: apigatewayUtil.bat restore backup -name <backup_file_name>
Note:  
Once the backup is restored, you must restart the API Gateway instance.
*Restoring backup to a new instance:
1. Create a repository using S3 if not already created.
Note:  
The S3 details which we provide in the gateway-s3-repo.cnf should point to the location where we have backup files which was taken earlier.
2. In case of multiple backups, run the following command to retrieve a list of backups: apigatewayUtil.bat list backup
3. Run the following command to restore the data using the required backup file: apigatewayUtil.bat restore backup -name <backup_file_name>
Note:  
Once the backup is restored, you must restart the API Gateway instance.
Backup and Restore Commands
In command line, go to <Integration Server_directory>\instances\default\packages\WmAPIGateway\cli\bin and run the following commands to take a database backup or restore the backup files:
If you want to...
Command
Take a backup
apigatewayUtil.bat create backup -name <backupFilename>
Take a custom backup
apigatewayUtil.bat create backup -name <backupFile_name> -include <reference name>
where reference name can be analytics for analytics or assets for assets data.
Delete the backed up API Gateway data
apigatewayUtil.bat delete backup -name <backupFile_name>
Restore the backed up data
apigatewayUtil.bat restore backup -name <backupFile_name>
To retrieve all available backup files in the repository
apigatewayUtil.bat list backup
Delete a repository from API Gateway
apigatewayUtil.bat delete manageRepo
To retrieve all available repositories
apigatewayUtil.bat list manageRepo
To configure a repository in S3
apigatewayUtil.bat configure manageRepo -file <file_path>
Copyright © 2017 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback