Hyperglance has 4 volumes, one for the OS and three for data. To upgrade or move and keep this data you can detach the volumes from the old instance and attach to the new instance. Follow these instructions to do so: 


NOTE: Text in code area are to be issued on the relevant instance console


Step 1: Stop services and backup data on old Hyperglance instance


Shutdown postgres, wildfly, telegraf, kapacitor

sudo service wildfly stop
sudo service postgresql95 stop
sudo service telegraf stop
sudo service kapacitor stop


Backup in case you have changed settings 

sudo cp -R /opt/wildfly/ /var/lib/influxdb/data



Backup - create a directory to hold backup files, back up meta data and each database's data and shut down influxdb

sudo mkdir /var/lib/influxdb/wal/backup 
sudo influxd backup /var/lib/influxdb/wal/backup
sudo influxd backup -database telegraf /var/lib/influxdb/wal/backup
sudo influxd backup -database _internal /var/lib/influxdb/wal/backup
sudo influxd backup -database hyperglance /var/lib/influxdb/wal/backup
sudo influxd backup -database hyperglance_group_consolidated var/lib/influxdb/wal/backup
sudo influxd backup -database hyperglance_appTag_consolidated /var/lib/influxdb/wal/backup

sudo service influxdb stop



#copy changed files (runtime.properties, anything more?)


Step 2: Unmount volumes from the old Hyperglance instance


Unmount volumes

sudo umount -d /dev/xvdf
sudo umount -d /dev/xvdg




Go to AWS console in browser

Note down volume name and corresponding device mount
Detach /dev/xvdg and /dev/xvdf volumes using AWS console


Step 3: Stop services on new Hyperglance instance 


Shutdown influx, postgres, wildfly, telegraf, kapacitor

sudo service wildfly stop
sudo service postgresql95 stop
sudo service telegraf stop
sudo service kapacitor stop
sudo service influxdb stop




Step 4: Unmount volumes from the new Hyperglance instance 


Unmount volumes

sudo umount -d /dev/xvdf
sudo umount -d /dev/xvdg




Detach /dev/xvdg and /dev/xvdf volumes using AWS console



Step 5: Attach old volumes and restore data on new Hyperglance instance


Attach /dev/xvdg and /dev/xvdf to the new instance using the AWS console.


Mount attached volumes

sudo mount -a



copy over runtime files


Restore data

#restore - restore the previously backed up meta data and each database data.
sudo influxd restore -metadir /var/lib/influxdb/meta /var/lib/influxdb/wal/backup
sudo influxd restore -database telegraf -datadir /var/lib/influxdb/data /var/lib/influxdb/wal/backup
sudo influxd restore -database _internal -datadir /var/lib/influxdb/data /var/lib/influxdb/wal/backup
sudo influxd restore -database hyperglance -datadir /var/lib/influxdb/data /var/lib/influxdb/wal/backup
sudo influxd restore -database hyperglance_group_consolidated -datadir /var/lib/influxdb/data /var/lib/influxdb/wal/backup
sudo influxd restore -database hyperglance_appTag_consolidated -datadir /var/lib/influxdb/data /var/lib/influxdb/wal/backup

sudo chown influxdb:influxdb /var/lib/influxdb/ -R




Set telegraf to monitor if needed


Step 6: Start services on new Hyperglance instance 



Start services

sudo service influxdb start
sudo service telegraf start
sudo service kapacitor start
sudo service postgresql95 start
sudo service wildfly start