Tips and Tricks

Moving NOC-PS

Have you ever had hardware failure or just messed up your NOC-PS install?

Well here is how you can backup, move, and restore your installation with the following commands.

 

On the old NOC-PS VM:

==
Enable SSH if you have not done before:

– in the NOC-PS VM console press “escape” -> arrow down -> “OS shell”

passwd www-data
*choose password*
mv /etc/init.d/K50dropbear /etc/init.d/S50dropbear
reboot

Connect with a SSH file transfer utility with username “www-data” and the password chosen, and download the latest backup file from /backup, or make a new one with: pg_dump -U noc-ps | gzip¬† > backup.sql.gz
==

– Power down the old NOC-PS VM

– Install NOC-PS on new VM

– Update NOC-PS to the latest version via the web interface

– Enable SSH on new NOC-PS installation.

– Transfer the backup file to the new NOC-PS installation with a SSH file transfer utility

– Execute on the new VM:

su
killall php-cgi ; dropdb -U noc-ps noc-ps
createdb -U postgres -O noc-ps noc-ps
gzip -dc backup.sql.gz | psql -U noc-ps
reboot

Leave a Reply