This guide explains the steps to take when migrating a web server to a new machine and/or a new platform. Most of it will also apply to any other type of server.
ccalypso
on Pandora to facilitate copying folders and files with the following content:#!/bin/bash if [ "$2" == "" ]; then exit 1 fi sudo rsync -avz -e 'ssh -i /home/user/.ssh/id_ecdsa -p 22' --rsync-path='sudo rsync' $1 user@dest.ip.addr:$2
$ ccalypso /home/user/folder-or-file /home/user/
$ sudo mv /etc/apache2/conf-available /etc/apache2/conf-available-debian $ sudo mv /etc/apache2/conf-enabled /etc/apache2/conf-enabled-debian $ sudo mv /etc/apache2/sites-available /etc/apache2/sites-available-debian $ sudo mv /etc/apache2/sites-enabled /etc/apache2/sites-enabled-debian
$ ccalypso /etc/apache2/conf-available /etc/apache2/ $ ccalypso /etc/apache2/conf-enabled /etc/apache2/ $ ccalypso /etc/apache2/sites-available /etc/apache2/ $ ccalypso /etc/apache2/sites-enabled /etc/apache2/
mysql
database$ mysqldump -u user -p --opt mysql > mysql.sql
$ sudo service mysql stop
$ sudo mv /var/lib/mysql /var/lib/mysql_debian
$ ccalypso /var/lib/mysql /var/lib/
$ sudo rm -R /var/lib/mysql/mysql $ sudo rm -R /var/lib/mysql/phpmyadmin $ sudo rm -R /var/lib/mysql/debian-10.1.flag
mysql_debian
folder to the mysql
folder copied from Pandora$ sudo mv /var/lib/mysql_debian/mysql /var/lib/mysql $ sudo mv /var/lib/mysql_debian/aria_log00000001 /var/lib/mysql $ sudo mv /var/lib/mysql_debian/aria_log_control /var/lib/mysql $ sudo mv /var/lib/mysql_debian/debian-10.5.flag /var/lib/mysql $ sudo mv /var/lib/mysql_debian/multi-master.info /var/lib/mysql $ sudo mv /var/lib/mysql_debian/mysql_upgrade_info /var/lib/mysql
/var/lib/mysql_debian
/etc/sudoers.d/