Report this

What is the reason for this report?

Migrate a PHP-MySQL backend to App Platform

Posted on May 29, 2021

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?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.