cd DIR && tar -cf - . | ssh newServerIP "cd DIR && tar -xpvf -"
This has the benfit of preserving the permission and ownership of the files.
dpkg --get-selections > PKGLIST
We transfer this PKGLIST to the new server and:
dpkg --set-selections < PKGLIST
Finally we tell apt-get to install the packages:
apt-get dselect-upgrade
If we have installed apt-file, we need to retrieve its filelists:
apt-file update
Depeding on package selection, this is now a very unsecure situation: Services are up and running, but are unconfigured! Thus we shut them down. For me these are:
/etc/init.d/apach2 stop /etc/init.d/exim4 stop /etc/init.d/courier-imap-ssl stop /etc/init.d/mysql-server stop
mysqldump --password=ZZZ --all-databases > /root/MYSQL_DUMP
…and after transfering, this could be
mysql -p < /root/MYSQL_DUMP
The logrotate script (and some other maintainance stuff) of mysql uses a special account – which has an (during package installation) autogenerated password. We need to look the new one up in
/etc/mysql/debian.cnf
(replace xxxxx belog with this) and finally we need to flush priviledges, thus all the permissions are correct and active:
mysql -p Welcome to the MySQL monitor. .... mysql> GRANT RELOAD, SHUTDOWN, PROCESS, SHOW DATABASES,\ SUPER, LOCK TABLES ON *.* TO \ 'debian-sys-maint'@'localhost' IDENTIFIED BY PASSWORD 'xxxxxx' mysql> FLUSH PRIVILEGES;
adduser NAME --uid UIDofOldSERVER
/etc/shadow
. While updateing
/etc/groups
take care about changed GID of gorups like www-data!
/etc/apache2
and the normal www stuff from
/var/www
, which includes gallery pix for me. and finally, dokuwiki’s data needs to be transfered from
/usr/share/dokuwiki/
/etc/courier
/etc/exim4
, maybe also
/etc/exim
, if aliases are defined there. Afterwards
/etc/spamassassin
needs to be transfered and checked if the deamon must be enabled in
/etc/default/spamassassin
. If you run mailinglists by mailman, transfer
/etc/mailman
as well as
/var/lib/mailman
, which includes the old archives.
Afterwards have a look, if
/usr/local/
contains software, which might need to have special maintainance, if CPU architecture is different.
/etc/ssh/sshd_config
for not allowing root login any longer.