VPS Migration Centos 7 with Sentora PHP 7

I just need to write it down, so just in case we need to move the VPS again I can call it out. Here are the steps :

  1. Find another cheaper and reliable VPS. Found it in Germany VPS provider, contabo.com . Surprisingly affordable and reliable. My choice goes to VPS SSD size M which is only 8.99 EUR per month, with more than enough specs. Just check their web for prices and specs
  2. Backed up my old files and databases in my old VPS
  3. Setup my new VPS with clean install OS (contabo provided it just pick it up on the list), minimum requirement, Centos 7 64bit.
  4. Preparing for control panel installation, I use Sentora, the details are here : https://www.osradar.com/how-to-install-sentora-on-centos-7/
  5. Because sentora comes with outdated PHP, Mysql, and Modules, so we need to upgrade them one by one. However I love Sentora, it was like CP for dummies, which is I am, just can’t move on to another CP yet.
  6. Upgrade MariaDB 5.5 to 10.1, check this out https://www.hostnextra.com/kb/how-to-upgrade-mariadb-5-5-to-10-4-on-centos/
  7. Upgrade PHP 5.4 to 7.3, check this out https://www.zerostopbits.com/how-to-upgrade-php-5-4-to-php-7-3-on-centos-7-5-1804/
  8. The Important thing to do before PHP upgrade is to disable PHP-Suhosin extension. Use yum remove php-suhosin, otherwise just commented at php-suhosin conf file at /etc/php.d
  9. Make sure that your earlier PHP extension installed, mine were /10-opcache.ini, /20-bcmath.ini, /20-bz2.ini, /20-calendar.ini, /20-ctype.ini, /20-curl.ini, /20-dom.ini, /20-exif.ini, /20-fileinfo.ini, /20-ftp.ini, /20-gd.ini, /20-gettext.ini, /20-iconv.ini, /20-imap.ini, /20-intl.ini, /20-json.ini, /20-ldap.ini, /20-mbstring.ini, /20-mysqlnd.ini, /20-pdo.ini, /20-phar.ini, /20-posix.ini, /20-shmop.ini, /20-simplexml.ini, /20-sockets.ini, /20-sqlite3.ini, /20-sysvmsg.ini, /20-sysvsem.ini, /20-sysvshm.ini, /20-tokenizer.ini, /20-xml.ini, /20-xmlwriter.ini, /20-xsl.ini, /30-mcrypt.ini, /30-mysqli.ini, /30-pdo_mysql.ini, /30-pdo_sqlite.ini, /30-wddx.ini, /30-xmlreader.ini, /30-xmlrpc.ini, /40-apcu.ini, /40-zip.ini, /imagick.ini. And plus ioncube loader for PHP 7.3. Imprortant link : https://www.mysterydata.com/how-to-install-php-opcache-apc-apcu-memcached-and-redis-on-vesta-cp-centos/. And https://www.tecmint.com/install-ioncube-loader-in-centos-7/
  10. So we now have updated PHP and MariaDB, is that all? unfortunately not. Sentora old modules like phpsysinfo and roundcube webmail won’t be running in our new system, so we will updating them also. We’ll take care of them later, first thing first. We need to set up domain and DNS in sentora. So easy, easiest control panel is sentora.
  11. After domain and DNS all set up, then we prepare to copy the web backup file from the old directory VPS to new one using scp command via SSH. https://linuxize.com/post/how-to-use-scp-command-to-securely-transfer-files/ . And then we import our database using mysql -u username -p databasename < databasenamebackup.sql
  12. Because i use WordPress as CMS and already activated SSL on my web so i have to revert it temporarily in wp-config file (by add define site ulr to http://) and deactivated the SSL plugin by renaming it.
  13. Luckily i have set up Cloudflare as my CDN so it makes so much easier for migrating the website. Just deactivated SSL and change the IP Address pointing to new VPS and voila, it was running in an instant, no need to wait for propagation.
  14. So we now have a fully running website but still not with an SSL connection. And we have to set up certbot installation for a free SSL certificate from Letsencrypt. https://www.liquidweb.com/kb/how-to-setup-lets-encrypt-on-centos-7/ and don’t forget to set up crontab to auto-renewal the certificate
  15. Is that all? not yet. We have to configure the SSL connection through the 443 port in Sentora. https://community.letsencrypt.org/t/easy-instructions-install-lets-encrypt-for-zpanel-sentora/46143
  16. We have a fully functional SSL website and now it’s time to fix Sentora’s old modules so it can running properly.
  17. Updating Phpsysinfo, just copy the new release to it’s app directory at /etc/sentora/panel/etc/apps/phpsysinfo
  18. Updating Roundcube email, http://forums.sentora.org/showthread.php?tid=4129&highlight=update+roundcube. Fixing roundcube password change for user http://forums.sentora.org/showthread.php?tid=1417&page=2. Fixing SMTP connection on roundcube mail change config file at /etc/sentora/configs/roundcube and /etc/sentora/panel/etc/apps/webmail/config, the file is config.inc.php
  19. Using TLS for sending email, cek dovocot file config, Postfic main.cf and master.cf
  20. Using vhost to making webmail.yourdomain.com working http://forums.sentora.org/showthread.php?tid=495&highlight=webmail But still, you have to configure DNS zone manually via SSH since I don’t know somehow you can’t add A record of this webmail into your sentora. Here’s the location /etc/sentora/configs/bind/zones
  21. Fixing proftpd not installed on centos 7 http://forums.sentora.org/showthread.php?tid=4243&pid=23202#pid23202
  22. Fixing FTP page not showing up http://forums.sentora.org/showthread.php?tid=10734
  23. Updating PhpMyAdmin, basically the same as Phpsysinfo. http://forums.sentora.org/showthread.php?tid=4132
  24. You might want to add a swap file on your centos server https://www.netweaver.uk/create-swap-file-centos-7/
  25. Last add, change my MPM apache from prefork to the event so it can handle much more server requests. And for that, we also have to install and configure PHP handler from mod_php to mod_fcgi or PHP-FPM. Check this one out https://www.stephenrlang.com/2018/02/centos-7-apache-2-4-with-php-fpm/
  26. I’ve tried to use PHP 8.1 on sentora and it failed. So i decided to use different PHP version 7.4 for sentora and 8.1 for websites. It works! https://learncode24h.com/how-to-run-multiple-version-php-with-apache-use-sentora-panel-on-centos/
  27. Install Suhosin alternative for PHP74 (Snuffleupagus) for Centos7

    Install Howto

    1. Download latest remi-release rpm from
      http://rpms.remirepo.net/enterprise/7/remi/x86_64/
    2. Install remi-release rpm:
      # rpm -Uvh remi-release*rpm
    3. Install php73-php-snuffleupagus rpm package:
      # yum --enablerepo=remi install php73-php-snuffleupagus

28. Setup DKIM, SPF and Dmarc for good email server authentication and deliverability