I have tried many ways to deploy my local server project to live server or another PC but not working very well.

so please give me a better and exact solution for it.

thanks in advance.

  • Do you use any automation tool for it ? – Abdul Pathan Jun 26 '19 at 11:30

If you are doing it manually this is the process.

  1. Copy whole project to your server machine in the deployment path(probably /var/www/html in linux).
  2. Dump your SQL database from your local machine.
  3. Create a new database in server and import the dumped SQL file.
  4. Change the base_url from your database. Update your project URL with new Server accessible URL.
UPDATE `core_config_data` SET `value`='http://myserver.com' WHERE `path` = 'web/unsecure/base_url'
UPDATE `core_config_data` SET `value`='https://myserver.com' WHERE `path` = 'web/secure/base_url'

Note: Replace https://myserver.com with your server URL.

  1. Now Update your app/etc/env.php, change database name, database host, database Username & password with the new ones.
  2. Delete all the content from generated/*, var/*, pub/static/*.
  3. Set Recursive Write permissions to generated/, var/, pub/static/.
  4. Now run these commands.
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f

Now everything should work properly...!!

  • Yeah Thanks! I will this tried but sometime not working well. so is there any specific solutions ? or this is the final one? – sarvesh Dineshkumar Patel Jun 28 '19 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.