XorMon migration

To migrate XorMon instance (source and target PostgreSQL and TimescaleDB should be same) follow these steps:

Source instance

  1. Create backup as postgres user
    su postgres
    pg_dump -Fc -f xormon-backup.dump  -d xormon
    
  2. Shutdown the instance under xormon user
    su xormon
    cd ~/xormon-ng/
    ./xormon.sh stop
    
  3. copy and transfer configuration file(.env-backup) onto the new vm under xormon user
    cp ~/xormon-ng/server-nest/.env ~/xormon-ng/server-nest/.env-backup
    

Target instance

  1. Make sure new XorMon instance has network access to all devices on specific ports.
    Refer to this table.

  2. shutdown the instance under xormon user
    cd ~/xormon-ng/
    ./xormon.sh stop
    
  3. Prepare target database under under postgres user
    su postgres
    psql -c "CREATE DATABASE xormon"
    psql -d xormon -c "CREATE EXTENSION IF NOT EXISTS "uuid-ossp";" -c "CREATE EXTENSION timescaledb;" -c "ALTER SYSTEM SET timescaledb.restoring = on;" -c "SELECT pg_reload_conf();"
    
  4. Restore database
    pg_restore --dbname=xormon --no-owner --role=postgres xormon-backup.dump
    
  5. Cleanup
    psql -c "ALTER SYSTEM RESET timescaledb.restoring;" -c "SELECT pg_reload_conf();"
    
  6. move the configuration file into place under xormon user
    mv .env-backup ~/xormon-ng/server-nest/.env
    
  7. start up the instance under xormon user
    cd ~/xormon-ng/
    ./xormon.sh start