This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

Symfony Migration from cPanel to Cloudways Platform

Updated on December 17, 2021

5 Min Read
migrate symfony

Symfony is a very popular MVC framework for banking and ecommerce applications. In order to extract maximum performance from the framework, it is essential that the applications should be deployed on cloud hosting solutions. In many cases, developers often miss out on this performance hack and opt for shared hosting solutions that do not provide the optimal platform for Symfony applications. Thus, an important challenge is the process of Symfony migration from traditional hosting solutions to managed cloud hosting solutions.

Symfony gives all the required tools to utilize databases in your applications, including the likes of Doctrine library, the best set of PHP libraries to work with databases. Database migrations are a way to securely overhaul your database pattern, both locally and on production. Rather than running the doctrine:schema:update command, or applying the database changes manually with SQL statements, database migrations allow you to duplicate your database’s changes in a secure way.

In this tutorial, I will explain how you could migrate Symfony sites from cPanel-powered shared hosting to managed cloud hosting offered by Cloudways. Also, see cPanel alternatives here. Migrating Symfony to a different host is easy enough. The process of migrating Symfony Websites to Cloudways starts with signing up for an account on Cloudways. Next, follow these steps to help migrate your Symfony website.

How to Install Drupal 9 on Cloudways

Step 1: Backup the Symfony Website

Login to the cPanel hosting account.

logging to cPanel

Next, create a zip archive of all the files inside the Symfony folder.

creating zip archive on cPanel

Once the compression process finishes, login to the database manager (PHPMyAdmin in many cases) and export the database(s) to the local system.

You might also like: How to Install PHPMyAdmin

exporting database for symfony

Add the database to the folder that contains the Symfony zip archive. This way, all relevant data could be downloaded imported to Cloudways through SSH terminal.

You are now done with your old hosting.

Nothing as Easy as Deploying PHP Apps on Cloud

With Cloudways, you can have your PHP apps up and running on managed cloud servers in just a few minutes.

Step 2: Launch Cloudways PHP Stack Application

Login to Cloudways Platform and launch a PHP stack application. In case of problems, refer to the following GIF.

DO installation

Step 3: Start the Symfony Migration Process

Now launch SSH terminal (or download PUTTY) and login with your server’s Master Credentials.

Server Management

connecting using putty

You Might Also Like: Migrate PHP With Ease

Now, to access public_html folder of the application, enter the following command in the terminal.

cd applications/<your application name>/public_html/

where <your application name> can be found on the Cloudways platform by clicking on the newly added PHP application and then going to the Application Setting tab.

application setting

Now, inside the public_html,  use the following command to remove all the files in the folder.

rm -rf *

The folder is now empty. The next step is to download the zip archive from the shared hosting Now the folder is empty let’s now download the zip that we have created in your shared hosting through the domain. For example, if your domain is abc.com then the download URL for the zip archive is abc.com/Smyfony.zip.

Is cPanel’s complexity and dated design slowing you down?

Cloudways makes web hosting easier and intuitive – even if you’re not a developer!

You Might Also Like: Pitfalls of Laravel Shared Hosting for Your Projects

In the terminal, type the following command to download the zip archive in the in the public_html folder.

wget yourdomain.com/Symfony.zip

download zip archive

Once done, unzip the file.

unzip Smyfony.zip

Next, edit Symfony database parameters from SSH terminal using the following command

vim app/config/parameters.yml

adding database credentials in symfony

Press i to start editing the file. Copy the database credentials from the  Application Access Details and replace the existing credentials. Once done, press Esc and enter :wq to save and exit the file.

You might also like: Using multiple databases in Symfony on Cloudways

Next Import the database to Cloudways. For this, first download the database to public_html using the following command.

wget yourdomain.com/database.sql

After the download finishes, type the following command to import the database into Cloudways.

mysql -u <username> -p <databasename> < database.sql

Where <username>, <databasename> can be found in Application Access details. The command will ask for the password.

importing database to cloudways

Once the processing finishes, you should visit the staging URL of the PHP app to check out your Symfony based website/app.

You might also like: Symfony Performance Benchmarks on Cloudways

Conclusion

The Doctrine Migrations project offers the additional functionality of the DBAL and ORM for designing your database. It makes it simple and secure to send changes in a way that can be reviewed and tested before being sent to production.

In this tutorial, I discussed the process of Symfony migration to Cloudways in three simple steps. Here is a short introduction and list of major topics in this Symfony series. If you have any questions or would like to add to the discussion, please leave a comment below.

Share your opinion in the comment section. COMMENT NOW

Share This Article

Customer Review at

“Cloudways hosting has one of the best customer service and hosting speed”

Sanjit C [Website Developer]

Inshal Ali

Inshal is a Content Marketer at Cloudways. With background in computer science, skill of content and a whole lot of creativity, he helps business reach the sky and go beyond through content that speaks the language of their customers. Apart from work, you will see him mostly in some online games or on a football field.

×

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!

×

Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!