Question

Migrate a PHP-MySQL backend to App Platform

Posted May 29, 2021 73 views
MySQLPHPDigitalOcean Droplets

I currently have a PHP backend that uses a MySQL database hosted on a droplet (a VPS). Now I want to migrate it to App Platform to relieve ourselves from maintaining the VPS. Is there a guidance document about this issue? How to get help about this?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi there @mehdiberrebouh,

What I would personally do in this case is:

  • Spin up a Managed Database cluster
  • Export your database from your Droplet and import it to the Managed cluster.
  • Then update your connection string to point to the new Managed database cluster so that your application would use it instead of the local MySQL server.
  • With that you would have half of the work is actually done, the next step would be to link your GitHub repository with the App platform, add the necessary environment variables like the details for the managed database cluster and then deploy the application

You can follow the steps on how to deploy a PHP application to the app platform here:

https://docs.digitalocean.com/products/app-platform/languages-frameworks/php/

  • Once you are done with the deployment, you can test the application fully and when you are sure that everything is working as expected, then you could point your domain to the App platform.

Hope that this helps.
Regards,
Bobby