As mentioned in the previous post, our server migration involved consolidating a web server into a DB server - we chose this method, since cloning the DB server was quick, while export followed by import of MySQL databases takes quite a bit longer as noted in the earlier 2024 migration post.
Copied the ssh private key for the destination server to the source server, and created an rclone remote using SFTP to the destination server.
zip -r -q webserver1.zip /path/to/webserver/files
(repeated this for all the web server directories later)
rclone copy webserver1.zip rcloneremote:/home/azureuser
(repeated this for all the other zip files later)
From the destination server,
unzip webserver1.zip
cd path/to/webserver/
sudo mv files /path/to/webserver
cd /path/to/webserver
sudo chown -R azureuser:www-data .
sudo chmod -R 775 .
----------------------------------------------
Then, the apache config files -
sudo zip -r -q etcapache.zip /etc/apache2
(rclone copy etc, and change ownership to root)
and the letsencrypt certificates etc,
sudo zip -r -q etclets.zip /etc/letsencrypt
(rclone copy etc, and change ownership to www-data for the file/directory which it needs, and the others to root)
-----------------------------------------------
With these, the files to be copied for the web servers were done. And I could start them up -
sudo a2ensite webserver1
sudo systemctl reload apache2
etc.
Also needed were
- installing all the necessary apache and php modules - which I had done earlier using the steps at the 2024 migration post.
- installing restic for backups as per the backups section of that post.
- rclone copy, individually, for the .sh backup scripts and the notifier directory.
- Copy-pasting lines from .config/rclone/rclone.config as noted in the restic backup script - the rclone config was modified by copy pasting the extra remotes from source to destination.
- Copy-pasting cron jobs from both crontab -e and sudo crontab -e
- Setting up postfix with gmail smtp as mentioned at this post for which
sudo apt remove ssmtp
sudo apt install mailutils postfix
and then editing the conf files was required.
sudo nano /etc/cron.d/awstats
Solution was to install ghostscript,
sudo apt install ghostscript
--------------------------------------------------------
Then the php max_file_upload also had to be modified according to this earlier post, https://hnsws.blogspot.com/2021/03/some-post-install-changes-needed-for.html
sudo nano /etc/php/8.3/apache2/php.ini
( Ctrl+w to find and change post_max_size
Ctrl+w to find and change upload_max_filesize
Ctrl+w to find and change max_execution_time - set to 600 for now.)
sudo systemctl restart apache2
and also did the same for /etc/php/8.3/cli/php.ini
-----------------------------------------------------------
When upgrading a plugin, a warning was shown that php extension soap was not installed, and that update will continue only after it is installed. So,
sudo apt install php-soap
-------------------------------------------------------------
No comments:
Post a Comment