How to transfer a Laravel application?

Laravel supports the usage of multiple database management systems – MySQL, PosgreSQL, SQLite and so forth.

After you transfer a Laravel website you have to perform a few actions regarding not only the transfer of the PHP files themselves but the database the script used.

You will have to perform a “dump” through PHPMyAdmin or PHPPgAdmin, depending on the database server your application used.

You can see that in a file that is usually located in app/config/database.php. From there you can see the name of the database your application had used and export it so that you can import it before moving the application on our servers.

Before you import the database you’ll have to create a brand new empty database and username for it. After that you have to assign the user to it with full privileges. You can use the user password from the previous installation to make the transfer easier.

NB!
Please notice that if you’re moving your site from one shared server to another you may need to change the table prefix.

Then you should navigate to PHPMyAdmin or PHPPgAdmin and import your database dump to the database that you just created.

 

 

 

 

On a shared hosting account your MySQL database prefix is your cPanel username. After creating the new database for your application you may need to change the prefix in the app/config/database.php file accordingly.

You can see your MySQL database prefix from the cPanel menu called MySQL databases.

This is also the place from where you can create a MySQL user and assign it to a database.

For example
‘database’ => ‘prefix_laravel’

will have to become
‘database’ => ‘cpuser_laravel’

 

Make sure the MySQL username is assigned to the correct database and that the password for the user is entered correctly in the app/config/database.php configuration file.

After that your application is set and your Laravel application transfer is complete!

You can always contact us if you have any troubles transferring it and our Tech Team will help you with the Laravel setup.

WebHostFace

Share
Published by
WebHostFace