1

I made a backup of Magento 2 and copied the whole site to another host. I extracted files and created a database. Now I get no CSS loaded. They all are "missing".

First I thought that it was caching or rewrite module problem, but now I found that if I deploy the static content, only en_US is deployed, although my default is ru_RU (this is where the CSS files are attempted to be loaded from).

Muhammad Farzam
  • 319
  • 4
  • 21
Leech
  • 17
  • 1
  • 4

3 Answers3

2

The main command it's below that will deploy the en_US and ru_RU:

php -f bin/magento setup:static-content:deploy en_US ru_RU

If doesn't work run these commands:

alias mage="php -d memory_limit=-1 -f bin/magento"

chmod -R 775 pub/static/ var/ pub/media/ &&
rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/tmp/ var/generation/ pub/static/frontend/ ;
php -r "opcache_reset();"
mage deploy:mode:set developer;
mage setup:static-content:deploy en_US ru_RU;
mage cache:flush &
mage indexer:reindex &
mage setup:upgrade &&
mage setup:db-data:upgrade &&
mage dev:source-theme:deploy &&
chmod -R 775 pub/static/ pub/media/ var/
Rafael Corrêa Gomes
  • 13,309
  • 14
  • 84
  • 171
1

You need to run deploy command for all languages as below.

php bin/magento setup:static-content:deploy en_US ru_RU
Kishan Patadia
  • 5,609
  • 3
  • 24
  • 36
0

Please run following ssh command on the magento directory. Please, check your directory(using pwd command ) before running any command.

1- rm -rf var/*

2- rm -rf pub/static/*

3- php bin/magento setup:upgrade

4- php -f bin/magento setup:static-content:deploy en_US ru_RU

5- chmod -R 777 var pub/static

6- php bin/magento indexer:reindex

Abhinav Singh
  • 2,592
  • 15
  • 14