VPS Migration Centos 7 with Sentora PHP 7

I just need to write it down, so just incase 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. 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 running in our new system, so we will updating them also. We’ll take care them later, first thing first. We need to setup domain and DNS in sentora. So easy, most easiest control panel is sentora.
  11. After domain and DNS all set up, then we prepare to copy web back up file from 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 SSL plugin by renaming it.
  13. Luckily i have setup cloudflare as my CDN so it makes so much easier for migrating the website. Just deactivated SSL and change IP Address pointing to new VPS and voila, it was running in instant, no need to wait for propagation.
  14. So we now have a fully running website but still not with SSL connection. And we have to setup certbot installation for free SSL certificate from Letsencrypt. https://www.liquidweb.com/kb/how-to-setup-lets-encrypt-on-centos-7/ and don’t forget to setup crontab to auto renewal the certificate
  15. Is that all? not yet. We have to configure SSL connection through 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 old modules to 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 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 in to your sentora. Here’s the location /etc/sentora/configs/bind/zones
  20. Fixing proftpd not installed on centos 7 http://forums.sentora.org/showthread.php?tid=4243&pid=23202#pid23202
  21. Fixing FTP page not showing up http://forums.sentora.org/showthread.php?tid=10734
  22. Updating PhpMyAdmin, basically same like Phpsysinfo.
  23. You might want to add swap file on your centos server https://www.netweaver.uk/create-swap-file-centos-7/
  24. Last add, change my MPM apache from prefork to event so it can handle much more server requests. And for that we also have to install and confgure 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/

605 Replies to “VPS Migration Centos 7 with Sentora PHP 7”

Leave a Reply

Your email address will not be published. Required fields are marked *