AbdulBazith's avatar

How to do modification like migration, package installation in laravel after uploading in cpanel

Guys iam working with a project like Inventory control system.i have completed the project 80%.

need to modify it. but i have uploaded in cpanel with partial work..

i have a employee module, in that i need to upload image of employee. but before that i have uploaded the project to Cpanel.

now in local i am doing that image upload correction.

for image upload i used the package in local

intervention/image

Now how can i install the package in the cpanel?

and also i need to add one or two tables with primary key and foreign key, in cpanel.

how can i perform a migration in the cpanel?

Simply to ask, how can i add/modify a package? add/ modify a table with migration in cpanel laravel project after uploading it in cpanel.

Some one help please. Suggest your ideas.

0 likes
8 replies
siangboon's avatar

SSH into the server and run the command.. .but i doubt you may not have the permissions to execute the command.

generally, once you installed package at your local, you may able to upload and override it your server site. all the packages are stored inside the vendors folder and you may need to override the package.json as well.

AbdulBazith's avatar

@siangboon ya u are right i should over ride the file thats the best solution ok i will do it.

if i need to add a new table means what can i do?? i know we can create a table in the server itself, but creating table using migration makes easy and the table also hast the correct flow of primary key and foreign key.

thats why iam asking..

siangboon's avatar

for creating new table you can just export the table from your local database server and import into the new server, the primary/foreign key will be in; For altering table you may need to manually update it and it's not a frequent tasks also.

The db migration just help and keep track your changes and allow you to rollback when needed but eventually it just a exact table you need. If you need easier flow you may go for Laravel Forge, otherwise virtual machine may what you need....

AbdulBazith's avatar

@siangboon you are right, simply i can export the table from my local server and then import it to the cpanel.

but first i have db in the cpanel and the customer started using that. now they have entered some data in that db.

in my local i made a change. i have created a new table. now i need to add that table to the cpanel db.

if i import my local server db to cpanel db then customer entered data will be erased.

so what can i doo??

is there any solution please???

siangboon's avatar

@ABDULBAZITH - since it's new table then you may just import the table using phpmyadmin instead of whole database

AbdulBazith's avatar

@siangboon how can i import a new table in phpmyadmin.

we can only import a full db. can we import a single table in db??

siangboon's avatar
Level 54

The dump *.sql file that you export and import is just a bundle of scripts of create table or insert data, sure you can import it or even open the query editor and execute it.

AbdulBazith's avatar

@siangboon thank you so much for your response.

You are right. what i did is first i exported my local .sql file and opened it in editor.

copied the code for which i created the new table. and then i moved to cpanel phpmyadmin there in the database i pasted that query and executed it.

so that the new table which i created in the local also created in the cpanel phpmyadmin.

thank you for you explanation..

Please or to participate in this conversation.