Migrate php website to digital ocean droplet or Google cloud compute

Good day somebody.

I am having trouble migrating a website that uses php and mysql to google compute engine.

This website is presently hosted with a web hosting company that utilize Cpanel 102.0.31 and it has been running on the web host for three years without any problem. Everything is working perfectly.

This website was developed on a local machine that run WampServer 3.2.0. The version of php on the WampServer I selected is 7.3.12, mysql 8.0.18 and the apache 2.4.41.

Because traffic is becoming much of this website, I learnt of cloud hosting. Though unfamiliar with the command line use, I have been trying Digital Ocean droplets for two weeks to no avail. I was able to install the droplet, latest apache 2.4.10 is installed by default and also install multiple version including php 7.3.13 using

 sudo add-apt-repository ppa:ondrej/php

<FilesMatch \.php$>
      # For Apache version 2.4.10 and above, use SetHandler to run PHP as a fastCGI process server
      SetHandler "proxy:unix:/run/php/php7.3-fpm.sock|fcgi://localhost"
    </FilesMatch>

Some of the problems I encounter is

  1. Log in page not working
  2. Information not saved to database
  3. And the website not behaving as it used to be

I have installed the latest version of php 8.2 before on the droplet but it is even worse in its behavior.

I felt this problem might be because of version incompatibility. I then thought if I can install the WampServer 3.2.0 that I am using on my local computer, may be the whole problem will be solved since the environment is the same. But I don’t know if this is possible with digital ocean and how to go about it. I read this question wordpress - Can I install WAMP on Microsoft Azure (Bizspark account)? - Stack Overflow. But they mentioned a lot of problems that I don’t know how to solved. And I don’t know if this will not slow down the website and we are currently having many visitors and the webs hosting cannot handle them quickly, sometimes the website will be down for 30 minutes.

I have signed up for google cloud platform. My questions is this
Can install WampServer 3.2.0 into google compute, will this solve the problem that the website will be up and running. Or there is another solution. I don’t even know how to go about any of this proposed solution if I am assured it will work. Therefore, I need some information on how I can get it done

Migrating a website to a new environment like Google Compute Engine can be a complex task, especially if you’re moving from a shared hosting environment with cPanel to a cloud server where you manage everything yourself. While replicating your WampServer environment on Google Compute Engine might sound like a solution, it can bring its own set of challenges.

Here’s a more typical approach you might consider, along with steps to help ensure a smoother migration:

1. Create a VM Instance with a Compatible Stack:

  • Use a LAMP (Linux, Apache, MySQL, PHP) stack on Google Compute Engine.
  • Choose a version of PHP that is compatible with your application. If it was developed with PHP 7.3.12, it might be best to start with that version.
  • You can use the Bitnami LAMP stack for Google Cloud, which provides a pre-configured environment and can save you some setup time.

2. Export Your Database:

  • Use phpMyAdmin or command-line tools to export your database from the current host.

3. Upload Your Website Files and Database:

  • Securely upload your website files to the new VM.
  • Import your database into MySQL on the new server.

4. Update Configuration Files:

  • Check your website’s configuration files for any settings specific to your old environment, such as database connection information. Update these to match your new environment.

5. Test the Site:

  • Before updating your DNS to point to the new server, test the site using the IP address or a temporary domain name.

6. Check for Errors:

  • Review the Apache and PHP error logs to identify any issues.
  • You may need to modify .htaccess files or Apache configuration to match your previous environment, especially if you’re facing issues like login pages not working.

7. Optimize for Performance:

  • Depending on your traffic and website complexity, you may want to consider additional optimizations, such as caching, CDN integration, or more powerful VM configurations.

8. Update DNS:

  • Once everything is working correctly, update your DNS to point to the new server.

Consider Professional Assistance:

If all this seems overwhelming, consider hiring a professional or managed service provider with experience in migrating PHP/MySQL websites to Google Cloud. They can help ensure a smooth transition with minimal downtime.

About WampServer:

WampServer is specifically designed for Windows environments and wouldn’t be suitable for installation on Google Compute Engine, which typically runs Linux-based VMs. Instead, the approach outlined above mimics what WampServer provides but tailored for a production Linux environment.

Please remember that moving to a cloud server means you’ll be responsible for all aspects of server management, including security, backups, updates, and monitoring. If you’re unfamiliar with these tasks, a managed hosting provider, or leveraging Google Cloud’s managed services like App Engine, might be a more suitable option.

Sponsor our Newsletter | Privacy Policy | Terms of Service