Restoring the Eclipse Amlen server from a backup in the same environment

System administrators can restore the Eclipse Amlen server by using backed-up data in the same environment in which the backup operation was performed.

  • You can restore the backup configuration and store only to the Eclipse Amlen software level that is greater than, or equal to, the Eclipse Amlen software level that the file was created with. That is, you cannot use a backup file that was created for a later version of Eclipse Amlen to restore to an earlier version of server.
  • As part of the restore process, you must clean the store unless you are using a backup of the store for this operation. Cleaning the store deletes all persistent data, including messages, subscriptions, and client states.
  • MQTT quality of service levels of message delivery cannot be guaranteed.
  • If you restore the store from a backed up version, consider that:
    • All messages that were buffered in the store after the store was backed up are lost.
    • Retained messages that were sent after the store was backed up are lost.
    • Messages that were in store buffers when the store was backed up, and which were sent later and discarded from the store, are restored and resent when subscribers reconnect. They are not marked as duplicate messages for JMS and MQTT.
    • Retained messages that were replaced after the store was backed up are restored. The messages that replaced the retained messages are lost.
  • The commands must be capitalized as shown, and must use the double quotation marks as shown.
  1. Check that the Eclipse Amlen server is running by using the Eclipse Amlen REST API GET method with the following URI:
    http://<admin-endpoint-IP:port>/ima/v1/service/status/
  2. Set the Eclipse Amlen server to maintenance mode by using the Eclipse Amlen REST API POST method with the following URI:
    http://<admin-endpoint-IP:port>/ima/v1/service/restart

    Provide configuration data in the payload of the POST method by using the following schema. Content-type is set to application/json:

    
    {    
      "Service": "Server",
      "Maintenance": "start"
    }
  3. When the server is in maintenance mode, use your standard system tools to restore the contents of the backup file to the appropriate directories:
    • var/messagesight/data
    • var/messagesight/store
    Note: If you are operating in a Docker environment, ensure that you mount these directories on the host volume or volumes and restore the contents of the backup file to the corresponding host directory or directories.
  4. Restart the server in production mode by using the Eclipse Amlen REST API POST method with the following URI:
    http://<admin-endpoint-IP:port>/ima/v1/service/restart/

    Provide configuration data in the payload of the POST method by using the following schema. Content-type is set to application/json:

    
    {    
      "Service": "Server",
      "Maintenance": "stop"
    }
The following example shows creating a backup of the Eclipse Amlen server:
Check that the server is running:
[admin@localhost ~]$ curl -X GET http://127.0.0.1:9089/ima/v1/service/status
{ 
  "Version":"v1",
  "Server": {
    "Name": "TestSystem:9089",
    "UID": "aFWxYf32",
    "Status": "Running",
    "State": 1,
    "StateDescription": "Running (production)",
    "ServerTime": "2016-03-04T14:46:53.081Z",
    "UpTimeSeconds": 4134,
    "UpTimeDescription": "0 days 1 hours 8 minutes 54 seconds",
    "Version": "2.0 20160304-0400",
    "ErrorCode": 0,
    "ErrorMessage": ""
  },
  "Container": {
    "UUID":"034c91ce828a4f5c2c21d7cd7f04628368b63bd308825ec2d9dab5096ff04ca0"
  },
  "HighAvailability": {
    "Status": "Inactive",
    "Enabled": false
  },  
  "Cluster": {
    "Status": "Inactive",
    "Enabled": false
  },  
  "Plugin": {
    "Status": "Inactive",
    "Enabled": false
  },  
  "MQConnectivity": {
    "Status": "Active",
    "Enabled": true
  },  
  "SNMP": {
    "Status": "Inactive",
    "Enabled": false
  }
}

Set the server to maintenance mode:
[admin@localhost ~]$ curl -X POST \
>    -H  'Content-Type: application/json'  \
>    -d  '{
>          "Service": "Server",
>            "Maintenance": "start",
>           }
>   '   \
> http://127.0.0.1:9089/ima/v1/service/restart

[admin@localhost ~]$ curl -k -H "Content-Type: application/json" -X GET  
https://127.0.0.1:9089/ima/v1/service/status
{
  "Version":"v1",
  "Server": {
    "Name": "TestSysem:9089",
    "UID": "aFWxYf32",
    "Status": "Running",
    "State": 9,
    "StateDescription": "Running (maintenance)",
    "ServerTime": "2016-03-04T14:46:53.081Z",
    "UpTimeSeconds": 4140,
    "UpTimeDescription": "0 days 1 hours 8 minutes 57 seconds",
    "Version": "2.0 20160304-0400",
    "ErrorCode": 0,
    "ErrorMessage": ""
  },
  "Container": {
    "UUID":"034c91ce828a4f5c2c21d7cd7f04628368b63bd308825ec2d9dab5096ff04ca0"
  },
  "HighAvailability": {
    "Status": "Inactive",
    "Enabled": false
  },
  "Cluster": {
    "Status": "Inactive",
    "Enabled": false
  },
  "Plugin": {
    "Status": "Inactive",
    "Enabled": false
  },
  "MQConnectivity": {
    "Status": "Inactive",
    "Enabled": false
  },
  "SNMP": {
    "Status": "Inactive",
    "Enabled": false
  }
}

  
Restore the contents of the backed-up files to var/messagesight/data and var/messagesight/store as appropriate:
[admin@localhost ~]$ sudo unzip messagesight-11042015-0933.zip -d/
Archive:  messagesight-11042015-0933.zip   
  creating: /mnt/messagesight/data/   
  creating: /mnt/messagesight/data/config/[messagesight-11042015-0933.zip] mnt/messagesight/data/config/accepted.json password: 
extracting: /mnt/messagesight/data/config/accepted.json 
extracting: /mnt/messagesight/data/config/store.init 
extracting: /mnt/messagesight/data/config/testLicense.json 
extracting: /mnt/messagesight/data/config/ILMT_PROD.def 
extracting: /mnt/messagesight/data/config/ILMT_NONPROD.def  
inflating: /mnt/messagesight/data/config/IBMIoTMessageSightServer.service  
inflating: /mnt/messagesight/data/config/mqclient.ini  
inflating: /mnt/messagesight/data/config/server.cfg  
inflating: /mnt/messagesight/data/config/vmprofile.cfg 
extracting: /mnt/messagesight/data/config/MessageSightInstance.inited 
extracting: /mnt/messagesight/data/config/.serverCFGUpdated  
inflating: /mnt/messagesight/data/config/server_dynamic.json.org  
inflating: /mnt/messagesight/data/config/server_dynamic.json.bak  
inflating: /mnt/messagesight/data/config/server_dynamic.json   
 creating: /mnt/messagesight/data/certificates/   
 creating: /mnt/messagesight/data/certificates/keystore/  
inflating: /mnt/messagesight/data/certificates/keystore/AdminDefaultKey.pem  
inflating: /mnt/messagesight/data/certificates/keystore/AdminDefaultCert.pem   
 creating: /mnt/messagesight/data/certificates/LDAP/   
 creating: /mnt/messagesight/data/certificates/MQC/   
 creating: /mnt/messagesight/data/certificates/truststore/   
 creating: /mnt/messagesight/data/certificates/LTPAKeyStore/   
 creating: /mnt/messagesight/data/certificates/OAuth/   
 creating: /mnt/messagesight/data/certificates/PSK/   
 creating: /mnt/messagesight/store/  
 creating: /mnt/messagesight/store/com.ibm.ism/ 
extracting: /mnt/messagesight/store/com.ibm.ism/com.ibm.ism.0.store.lock   
 creating: /mnt/messagesight/store/persist/  
inflating: /mnt/messagesight/store/persist/PState  
inflating: /mnt/messagesight/store/persist/CPM_0_1  
inflating: /mnt/messagesight/store/persist/CPG_0_1  
inflating: /mnt/messagesight/store/persist/ST_0_0  
inflating: /mnt/messagesight/store/persist/ST_1_0  
inflating: /mnt/messagesight/store/persist/ST_0_1  
inflating: /mnt/messagesight/store/persist/ST_1_1
Restart the server in production mode:
[admin@localhost ~]$ curl -X POST \
>    -H  'Content-Type: application/json'  \
>    -d  '{
>          "Service": "Server",
>            "Maintenance": "stop",
>           }
>   '   \
> http://127.0.0.1:9089/ima/v1/service/restart
Check that the server is running in production mode::
[admin@localhost ~]$ curl -k -H "Content-Type: application/json" -X GET
 https://127.0.0.1:9089/ima/v1/service/status 
 "Version":"v1",
  "Server": {
    "Name": "TestSysem:9089",
    "UID": "aFWxYf32",
    "Status": "Running",
    "State": 1,
    "StateDescription": "Running (production)",
    "ServerTime": "2016-03-04T14:46:53.081Z",
    "UpTimeSeconds": 24,
    "UpTimeDescription": "0 days 0 hours 0 minutes 24 seconds",
    "Version": "2.0 20160304-0400",
    "ErrorCode": 0,
    "ErrorMessage": ""
  },
  "Container": {
    "UUID":"034c91ce828a4f5c2c21d7cd7f04628368b63bd308825ec2d9dab5096ff04ca0"
  },
  "HighAvailability": {
    "Status": "Inactive",
    "Enabled": false
  },
  "Cluster": {
    "Status": "Inactive",
    "Enabled": false
  },
  "Plugin": {
    "Status": "Inactive",
    "Enabled": false
  },
  "MQConnectivity": {
    "Status": "Inactive",
    "Enabled": false
  },
  "SNMP": {
    "Status": "Inactive",
    "Enabled": false
  }
}