Sunday, February 14, 2021

How to setup magento in alpha server



Steps to deploy in a server
-----------------------------------------------------
1. download data base to the local
2. download code to the local
3. transfer to server using filezilla  SFTP (using ppk in case of shared hosting)

    - Upload the latest DB backup (.gz file) to alpha hosting inside dev.mysqlstaging.com folder

   - unzip the db backup file. command: gunzip filename.sql.gz

4. setup putty for ssh 

        login to SSH through Putty. port 87

5. login to mysql in cmd. credentials are in app/etc/env.php

mysql -u username -p;

6. use database

7. import the db using source command.
Command: source path to sql file

SOURCE /home/mysupplystagin/dev.mysupplystaging.com/9feb2021.dbbckup.sql;

5. give permission chmod -R 777 var pub generated

COMMANDS AT MAGENTO FOLDER USING SSH


1. php bin/magento deploy:mode:set developer

2. php bin/magento setup:upgrade
-------------------------------------------------------------------
Area code not set error://error on setup upgrade

UPDATE flag SET flag_data = NULL WHERE flag_code = 'system_config_snapshot';
UPDATE flag SET flag_data = NULL WHERE flag_code = 'config_hash';
DELETE FROM flag WHERE flag_code = 'system_config_snapshot';

php bin/magento app:config:import
php bin/magento cache:clean
php bin/magento setup:upgrade
-------------------------------------------------------------------------------

3. php bin magento setup:di:compile
4.php bin/magento setup:static-content:deploy -f
5.php bin/magento indexer:reindex
6.php bin/magento cache:clean
7.php bin/magento cache:flush

---------------------------------------------------------------------------------

Access the server using the folder name

--------------------------------------------------------------------------------

//missing css files. 

fixed by uploading .htaccess file to pub/static





No comments:

Post a Comment