From ISP admin
Contents |
Migration of the system
This handbook should serve for service purposes, it may be, however, used also by the administrator of the OS who takes care of the ISP server of the company which is ready for the migration of the ISP admin system. If you wish to perform migration of the system by the tech support, contact us.
Old server - Export and deactivatoin
Stop Apache and Cron in the old server so that they do not carry out any changes and nobody enters the admin:
/etc/init.d/cron stop
/etc/init.d/httpd stop (32bit) or /etc/init.d/apache2 stop (64bit)
If the web interface is still running, it needs clicking on the services manually because Apache has not normally stopped, observed on the 32bit version:
killall cron
killall httpd (32bit) or killall apache2 (64bit)
the launching script must not be launched at the start:
mv /etc/rc3.d/S89cron /etc/rc3.d/K89cron
mv /etc/rc3.d/S96httpd /etc/rc3.d/K96httpd (32bit) or mv /etc/rc3.d/S96apache2 /etc/rc3.d/K96apache2 (64bit)
On the old server, there will be being a system backup created, which represent a great amount of data. It is thus advisable to ensure sufficiency of free space for following actions. Firstly, find out how much free space you currently have at disposal, if it is less than 10GB, delete some of the old system backups:
df -hl
du -sh /data/backup rm -rf /data/backup/2010_01_0*
Into the /root/ directory, copy the file of rrd_dump.pl
wget http://wiki.ispadmin.eu/download/migration/rrd_dump.pl
Switch into the /root and export all graphs into XML so that they can be imported (this may take a while):
cd /root
./rrd_dump.pl
We will create directories for the data export:
mkdir /root/export
We will copy the client contracts:
cp -av /data/support/ispadmin/smlouvy /root/export/
We will copy the client graphs backups:
cp -av /data/support/ispadmin/client_images/ /root/export/
Logo displayed in the invoice:
cp -av /data/support/ispadmin/images/billing/ /root/export/
Logos displayed in the client portal:
cp -av /data/support/ispadmin_support/images/billing/ /root/export/billing_support/
The database backup, password:
cat /data/support/ispadmin/config/config.php |grep PASS
mysqldump --add-drop-table --quote-names ispadmin -u ispadmin -p >/root/export/ispadmin.sql
Packing the whole backup into one compressed archive, this will be transferred onto the new server:
tar cfz /root/export.tgz /root/export
We will transfer the packed backup data onto the new server /root/export.tgz:
scp /root/export.tgz root@IP_noveho_serveru:/root/
New server - Import and configuration
On the new server, launch the update script:
ispadmin_update
Stop cron (will be automatically launched with the first reboot of the system)
/etc/init.d/cron stop
Decompress the data tranferred in the directory /root:
tar xvfz export.tgz
Import DB, the password into mysql after the installation is "isp123":
mysql ispadmin -u ispadmin -p </root/export/ispadmin.sql
Switch to the backup directory:
cd /root/export
Copy rdd backup into the directory /root:
mv dump /root/
Copy the script of rrd_import.pl into the /root directory
wget http://wiki.ispadmin.eu/download/migration/rrd_import.pl
Launch the import script, then all the router and client graphs should be seen as well as on the previous installation:
/root/rrd_import.pl
Copying of unlocked files, logo of invoices, logo in the client portal, contracts, into the newly installed system:
rm -rf /data/support/ispadmin/smlouvy/
mv contracts/ /data/support/ispadmin/
rm -rf /data/support/ispadmin/client_images
mv client_images/ /data/support/ispadmin/
rm -rf /data/support/ispadmin/images/billing/
mv billing /data/support/ispadmin/images/
rm -rf /data/support/ispadmin_support/images/billing/
mv billing_support/ /data/support/ispadmin_support/images/billing
UPDATE again so that also the table in MySQL were updated:
ispadmin_update
Update of the Debian distribution:
apt-get update; apt-get upgrade
After finishing the reinstallation, launch the following script to restore the configuration of the NAGIOS:
/usr/local/script/ispadmin/nagios_cfg.pl
Check whether forwarding e-mails through the superordinate "smtp server" is not used on the old server. If it is stated "relayhost = IP_superordinated_smtp_server" in the file /etc/postfix/main.cf, the same must be set also in the new installation.
cat /etc/postfix/main.cf |grep relayhost
Check whether own DNS servers are not set on the old server. Of they are, implement them into the file:
pico -w /etc/resolf.conf
Edit and configuration of new installation, proceed in the same way as for the configuration of new installation.
- Setting the domain names
- /etc/hostname and /etc/hosts
- Setting the web server
- /etc/httpd/conf/httpd.conf
- Setting passowrds
- Set new database passwords and change the root password.
- Activation of the licence
- Upload new licence on the server into the directory of /data/support/ispadmin/config/. If you do not have this licence for a new device, you can contact Mr. Sýs at the e-mail address sys@net-service.cz, the licence will be issued and immediately sent back to you in the replay to your e-mail. The licence for a new device is issued free of charge and in the same extent as the previous one. If you already have the licensing file for new installation, follow the configuration steps.
Note: If you are not successful at logging into the system administration, you need to switch the DB into the "old compatible mode". Into the /etc/mysql/my.cnf it is necessary to add a new line of old-passwords into the [mysqld] section, thus MySQL will use old password coding.
As the last step, restart the server so that all services upload into the correct settings:
reboot
Notes: In the end, do not forget to copy backup data /data/backup and NETflow /data/support/flow/default. However, remember that it may mean a large bulk of data in orderd of GBs. For this reason, it is advisable to have both devices on one physical segment and copy such a data bulk directly through the local network and not through the Internet. In the most ideal case when you have the system backups save daily on the FTP server and you do not have to transfer them then. The router backups ( text as well as binary ) are saved directly in the database, thus you do not have to solve them separately.
In one case, there has been a problem with the SMS gateway. After migration, the old notifications created by NAGIOS started being delivered, therefore it was necessary to delete the old notifications directly from the database. Finally, it is also advisable to run the following script to restore the NAGIOS configuration: /usr/local/script/ispadmin/nagios_cfg.pl