Reset Search
 

 

Article

KB44172 - Backup/restore binary configuration using REST API

« Go Back

Information

 
Last Modified Date3/10/2021 9:33 AM
Synopsis
Backup/restore binary configuration is added feature starting from PCS OS 9.1R1 

Following KB article will explain how to use Curl to export/import the binary configuration on VPN appliance.
Problem or Goal
Prerequesit:
  1. Curl 
  2. VPN with minimum PCS OS 9.1R1 or higher.
  3. Postman Client (any REST API client)
Cause
The postman client has some limitation with large responses to GET calls. You can try using some other method for the GET call (for backup configuration). I have used Curl for Windows to process GET calls.
Solution
Instructions to Export the Configuration

Step 1:
Enable REST API access on the admin user.
Under Admin GUI > Auth Servers > Administrators > Users > Update Administrator admin > Enable 'Allow access to REST APIs'

Step 2: Setup CURL to use for desired OS machine. (I haved used Windows in this case)

Step 3: Generate Auth Key
c:\curl\bin>curl -k -u admin:dana!23 -G https://<IP-Address>/api/v1/auth

Step 4: Export the configuration

Syntax Format:
c:\curl\bin>curl --insecure --user <AUTH KEY CODE>: -o <Location to store the backup file> https://<IP-Address>/api/v1/system/binary-configuration

Note: In the above syntax, we need to add colon after the <AUTH KEY CODE>


Example:
c:\curl\bin>curl --insecure --user S/gvPgeT48dpF5q+w5ooJFmWsndP4P4RH8LGaKghbKw=: -o /Users/admin/Documents/backup https://10.9.222.211/api/v1/system/binary-configuration

 
Curl Output
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 48.5M  100 48.5M    0     0  3242k      0  0:00:15  0:00:15 --:--:-- 11.9M
Admin Access Logs
Severity	ID		Message
Info		ADM20447	2019-05-27 13:02:25 - ive - [127.0.0.1] System()[] - Exported user configuration by administrator
Info		ADM20447	2019-05-27 13:02:17 - ive - [127.0.0.1] System()[] - Exported system configuration by administrator

Instructions to Import the Configuration

Below curl command that works for importing the configuration:

curl --insecure --request PUT 'https://10.96.112.83/api/v1/system/binary-configuration' --header 'Authorization: Basic AUTH_KEY' --header 'Content-Type: application/octet-stream' --data-binary '@/Users/test/Desktop/backup'

test@MacBook-Pro ~ % curl --insecure --request PUT 'https://10.96.112.83/api/v1/system/binary-configuration' --header 'Authorization: Basic AUTH_KEY' --header 'Content-Type: application/octet-stream' --data-binary '@/Users/test/Desktop/backup'
{
"result": {
"info": [

{ "message": "Operation successfully completed." }
]
}
}%

Note: Make sure to replace AUTH_KEY' with your actual auth key code.

Admin logs:
Info ADM20456 2021-03-01 20:28:25 - ive - [127.0.0.1] System()[] - Imported user configuration.
Info DAS31035 2021-03-01 20:28:24 - ive - [127.0.0.1] System()[] - Dashboard / Reporting enabled.
Info ADM24397 2021-03-01 20:28:20 - ive - [127.0.0.1] System()[] - ESAP package (version '3.4.8') activated.
Info ADM20456 2021-03-01 20:27:44 - ive - [127.0.0.1] System()[] - Imported system configuration.
Info DAS31035 2021-03-01 20:27:43 - ive - [127.0.0.1] System()[] - Dashboard / Reporting enabled.


Using postman to import the configuration to same or other appliance with same or higher OS version.

Syntax Format:
PUT https://<ip-address>/api/v1/system/binary-configuration?import=full


Example:
PUT https://10.9.222.211/api/v1/system/binary-configuration?import=full
Postman Output
{
    "result": {
        "info": [
            {
                "message": "Operation successfully completed."
            }
        ]
    }
}
Admin Access Logs
Info	ADM20456	2019-05-27 13:07:37 - ive - [127.0.0.1] System()[] - Imported user configuration.
Info	DAS31035	2019-05-27 13:07:36 - ive - [127.0.0.1] System()[] - Dashboard / Reporting enabled.
Info	ADM24397	2019-05-27 13:07:29 - ive - [127.0.0.1] System()[] - ESAP package (version '3.3.5') activated.
Info	ADM20456	2019-05-27 13:07:21 - ive - [127.0.0.1] System()[] - Imported system configuration.
Info	DAS31035	2019-05-27 13:07:19 - ive - [127.0.0.1] System()[] - Dashboard / Reporting enabled.
Related Links
Attachment 1 
Created ByGourinath Diojode

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255