Restore Apigee Postgresql

We have tried the below use case as part of Postgresql recovery.

Case: Recovery of Postgresql from backup dump when the previous analytics data was lost from postgres.

  1. Below is the backup command that we executed.
  • /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql backup

    As per the backup & restore documentation, script takes the backup of dump and token directory:

  • (year).(month).(day),(hour).(min).(seconds).dump
  • /opt/apigee/token/
  1. After taking backup of postgres, we have taken the screen shot of analytics graph in edge-UI in certain time interval (For Ex: 31st Jan 2018 to 15th Feb 2018).
  2. Purge the postgres data using below command to delete older than 1 day data in Postgres database. After running the below command it shows there is no data found in Postgres.
  • /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql pg-data-purge JPMCHASE LAB 1
  1. We have waited for 5 mins and refreshed the edgeUI and still we could see the analytics data in graph which is same as before purging data. We are not sure from where this analytics data is being pulled in edge-UI.

We are able to recover the Postgresql from dump if any data got lost. But we are able to retrieve the postgres analytics in edge-Ui even if we don’t recover as well.

0 3 688
3 REPLIES 3

@SURESHT, How many Analytics nodes you have installed ? Analytics data might be available in server cache.

After 5min, did you see new traffic being updated ?


@Latheef, We have 2 analytics nodes in our test environment. After purging all the data from Postgres, I could see new traffic is being updated. Now my postgresql has recent analytics only.

As per latest update we received, When we purge the analytics, the detailed data only got deleted. But the views created on detailed data will not be deleted. Hence we would need to know how to purge view data as well.