Line 30: |
Line 30: |
| | | |
| then go to the web interface, it will prompt you again for the configuration of the db | | then go to the web interface, it will prompt you again for the configuration of the db |
| + | |
| + | == migrate manually from one server to another == |
| + | |
| + | save files and config on old server |
| + | |
| + | cd /root |
| + | touch zabconfig |
| + | chmod 0700 zabconfig |
| + | config print zabbix-agent |sed 's/[=|]/ /g ; s/^/config set /' >zabconfig |
| + | config print zabbix-server |sed 's/[=|]/ /g ; s/^/config set /' >>zabconfig |
| + | # smeserver-zabbix-server smeserver-zabbix-agent smeserver-zabbix-proxy |
| + | if [ -d /etc/zabbix ]; then |
| + | for F in /etc/zabbix/*; do |
| + | rpm -qf "$F" >/dev/null 2>&1 || echo "$F" >>dir.list |
| + | done |
| + | fi |
| + | if [ -d /etc/zabbix/zabbix_agentd.conf.d ]; then |
| + | for F in /etc/zabbix/zabbix_agentd.conf.d/*; do |
| + | rpm -qf "$F" >/dev/null 2>&1 || echo "$F" >>dir.list |
| + | done |
| + | fi |
| + | if [ -d /var/lib/zabbix/bin ]; then |
| + | for F in /var/lib/zabbix/bin/*; do |
| + | rpm -qf "$F" >/dev/null 2>&1 || echo "$F" >>dir.list |
| + | done |
| + | fi |
| + | echo "/var/lib/zabbix/tmp/" >>dir.list |
| + | echo "/root/zabconfig" >>dir.list |
| + | tar cvzf zabbix.tgz -T dir.list --xattrs |
| + | mysqldump --ignore-table=mysql.event --single-transaction --add-drop-table -QB "$(config getprop zabbix-server DbName)" | gzip -c > /root/zabbix.sql.gz |
| + | |
| + | then scp to your new server(assuming you SCP from SME9 to SME10, you need to enable a common cipher |
| + | scp -c aes128-ctr /root/zabbix.tgz /root/zabbix.sql.gz root@newip:/root |
| + | |
| + | then, on new server, restore the data |
| + | tar -zxf zabbix.tgz --directory / |
| + | then restore the config keys |
| + | bash zabconfig |
| + | then restore the mysqldb, assuming you already had installed mariadb105 on sme10 |
| + | zcat zabbix.sql.gz |mysql105 |
| + | create user give him privileges |
| + | echo "CREATE USER IF NOT EXISTS `config getprop zabbix-server DbUser`@localhost IDENTIFIED BY '`config getprop zabbix-server DbPassword`';"| mysql105 |
| + | echo "GRANT ALL PRIVILEGES ON `config getprop zabbix-server DbName`.* TO `config getprop zabbix-server DbUser`@localhost; FLUSH PRIVILEGES;" | mysql105 |
| + | |
| + | then follow the wiki procedure to install zabbix z50 |