-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.me
128 lines (105 loc) · 5.04 KB
/
README.me
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
Code for reuse.
1. Import db
2. Change values in db:
SELECT * FROM `core_config_data` WHERE `path` LIKE '%base_url%' ORDER BY `scope_id` LIMIT 50
SELECT * FROM `core_config_data` WHERE `path` LIKE '%catalog/search/engine%' ORDER BY `scope_id` LIMIT 50
SELECT * FROM `core_config_data` WHERE `path` LIKE '%catalog/search%' AND `path` LIKE '%hostname%' ORDER BY `scope_id` LIMIT 50
Disable merging and minifying locally
update `core_config_data` set `value` = 0 where `path` IN('dev/js/merge_files','dev/css/merge_css_files','dev/js/minify_files','dev/css/minify_files');
Set local urls
update `core_config_data` set `value` = 'http://local.yoursite.com/' where `path` IN('web/unsecure/base_url','web/secure/base_url');
Adding admin user
admin:user:create --admin-user='jekabs' --admin-password='bryant4733' --admin-email='[email protected]' --admin-firstname='Admin' --admin-lastname='Admin'
Set developer mode
bin/magento deploy:mode:set developer
Set redis info in env.php
'session' => [
'save' => 'redis',
'redis' => [
'host' => 'redis',
'port' => '6379',
'persistent_identifier' => '',
'password' => '',
'timeout' => '2.5',
'database' => '2',
'compression_threshold' => '2048',
'compression_library' => 'gzip',
'log_level' => '1',
'max_concurrency' => '6',
'break_after_frontend' => '5',
'break_after_adminhtml' => '30',
'first_lifetime' => '600',
'bot_first_lifetime' => '60',
'bot_lifetime' => '7200',
'disable_locking' => 1,
'min_lifetime' => '60',
'max_lifetime' => '2592000'
]
],
'cache' => [
'frontend' => [
'default' => [
'backend' => 'Cm_Cache_Backend_Redis',
'backend_options' => [
'server' => 'redis',
'port' => '6379',
'persistent' => '',
'database' => '0',
'password' => '',
'force_standalone' => '0',
'connect_retries' => '1',
'read_timeout' => '10',
'automatic_cleaning_factor' => '0',
'compress_data' => '1',
'compress_tags' => '1',
'compress_threshold' => '20480',
'compression_lib' => 'gzip',
'use_lua' => '0'
]
],
'page_cache' => [
'backend' => 'Cm_Cache_Backend_Redis',
'backend_options' => [
'server' => 'redis',
'port' => '6379',
'persistent' => '',
'database' => '1',
'password' => '',
'force_standalone' => '0',
'connect_retries' => '1',
'lifetimelimit' => '57600',
'compress_data' => '0'
]
]
]
],
magento install
dockergento magento setup:install --base-url=http://local.test.lv/ --base-url-secure=https://local.test.lv/ --db-host=db --db-name=test --db-user=root --db-password=password --admin-firstname=Magento --admin-lastname=User [email protected] --admin-user=jekabs --admin-password=bryant4733 --language=en_US --backend-frontname=admin --magento-init-params=MAGE_MODE=developer --use-secure=0
Optional params for ES
--es-hosts="elasticsearch:9200" --es-user="username" --es-pass="password"
Msql core_config_data dump
docker exec viking_db_1 mysqldump -u root -ppassword vikingdb_jan core_config_data > local_ccd.sql
Get query string from Framework/DB/Select with $query->assemble();
Or put echo $_productCollection->getSelect()->__toString(); in a template file.
Switch to prod mode:
dockergento magento deploy:de:set production --skip-compilation
sudo rm -rf var/cache/* generated/* pub/static/* var/view_preprocessed/* var/page_cache/* var/generation/* dev/tests/integration/tmp/*
sudo -u www-data php bin/magento setup:static-content:deploy lv_LV ru_RU et_EE lt_LT en_US --theme devall/hp
sudo -u www-data php bin/magento setup:di:compile
sudo -u www-data php bin/magento setup:static-content:deploy --theme Magento/backend
Remove everything:
rm -rf generated/code* generated/metadata/* pub/static/* var/cache* var/page_cache/* var/page_cache/* var/view_preprocessed/*
DROP ALL TABLES
First, disable foreign key check:
echo "SET FOREIGN_KEY_CHECKS = 0;" > ./temp.sql
Then dump the db with no data and drop all tables:
mysqldump --add-drop-table --no-data -u root -p db_name | grep 'DROP TABLE' >> ./temp.sql
Turn the foreign key check back on:
echo "SET FOREIGN_KEY_CHECKS = 1;" >> ./temp.sql
Now restore the db with the dump file:
mysql -u root -p db_name < ./temp.sql
UPDATE `customer_entity`
SET `password_hash` = CONCAT(SHA2('xxxxxxxxOption123', 256), ':xxxxxxxx:1')
WHERE `email` = '[email protected]';
DUMP
mysqldump -u root -p magento2 -h 192.168.100.244 | gzip > ur_live-01-05-2020.sql.gz