Migrate postgres database From version 8.12 to version 9.0

Hi,

Can someone tell me how to migrate/move postgres database from one VM in 8.12 version to another VM in version 9.0. In both VM (Linux Debian) Sentry is installed using docker. I m a Sentry & Docker beginner.
I would like to export postgres data from Sentry V 8.12 and import data into Sentry V9.0 if it is possible and do the same with REDIS database

Any help will be much appreciated.