0

Please guide me how to move magento 2.3 from localhost to live server. Require step by step guide.

Please help!! Having problem in phpmyadmin while exporting the magento sql.

2 Answers 2

1
  1. create github account, create new repo.
  2. Go to the console of localhost , write next:

git init

git remote add origin https://github.com/user/repo.git

git add .

git commit -m "first commit"

git push origin master

3.Go to live ssh console and write next :

git init

git remote add origin https://github.com/user/repo.git

git clone https://github.com/user/repo.git .

4.After this give permissions to folders

sudo chmod -R 777 /var /generated /pub/media /pub/static

5.Go to localhost console and dump your database:

mysqldump -u youusername -p database_name > database.sql

6.Upload database.sql to live.And in live console write:

mysqldump -u youusername -p database_name < database.sql

7.Open myadmin or adminer, go to core_config_data table, find colums with name like web_secure_url and web_unsecure_url and put here your magento2 live url.

8.Run in live console commands:

composer install

composer update

If your already have public and secure keys from magento marketplace put them.

9.After this you just need run next commands:

bin/magento setup:upgrade

bin/magento indexer:reindex

bin/magentosetup:di:compile

bin/magento deploy:mode:set production

bin/magentodeploy:static-content en_US

And finish, go to your url in browser, and you will see your result!

If my answer was helpful , mark as answer please, to help other peoples find solution.

0
  1. It is suggested that you have a git repo for your project . If not , then inside your magento root :

    • git init
    • git remote add origin https://github.com/user/repo.git (make sure you have the .gitignore file paths you dont want to be pushed)
    • git add .
    • git push origin master
  2. You must have a server first, a domain for the server and some test subdomains.

    • Log in to your server , go to SSH Accounts (copy the credentials for the domain you are into and them in a text note)

    • It`s better to push your local into a dev site first , so you created the subdomain qa.yourwebsite.com , copy the SSH Credentials , login to a terminal or the best (i use it too ) PHP STORM .

    • Download Php Storm , login with SFTP with your credentials , and it will show your domain and some empty dir.

    • Create an src dir so it can be your magento root dir, connect with your repo running git pull (or you can do it with scp localpath to server path and then add the remove git path).

  3. The DATABASE

    • The difference in Server is the database , when i say database i mean credentials of env.php file . You must take the server db credentials you are connected and replace them in your old env.php.
    • If you are having issues with phpmyadmin , magerun2 its the best tool for exporting your database Download magerun in local and server and run:
    • magerun2 db:dump in local

    • scp the db in your server root

    • magerun2 db:import yourdatabase.sql in server

    Set base url in your server :

    magerun2 config:set --scope=default --scope-id=0 web/secure/base_url "https://yourwebsite.com/" magerun2 config:set --scope=default --scope-id=0 web/unsecure/base_url "https://yourwebsite.com/"

4 . Generating Vendor.

In your root run :

 composer install
 bin/magento setup:upgrade
 bin/magento setup:di:compile
 bin/magento setup:static-content:deploy



(You may fix the permissions again)

5 . Features:

  • Getting Varnish in your server.
  • Php latest version of the server (7.1.3+, 7.2.x at least)
  • Version of Elastic Search

Hope it helped you.

1
  • Doest this solution also transfer content (pages, blocks, widgets) and catalog (including images) created on local ?
    – Alex B
    Oct 27, 2020 at 3:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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