Skip to content

Commit afaa44f

Browse files
committed
Initial test of ignore tables
1 parent fceefeb commit afaa44f

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ local_backup_dir=/opt/magento/backups
4141
local_shared_deployment_dir=/opt/magento/deployment/shared/magento
4242
local_file_user=magento
4343
local_file_group=magento
44+
ignore_tables="mageplaza_smtp_log"
4445
```
4546

db-sync.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,20 @@ source "${dbsyncutil}menu.sh"
1313

1414
# Make sure we are in a Magento directory
1515
if [ ! -f "bin/magento" ]; then
16-
printf '%-1s %-80s %-1s' "${bg_red}${txt_white}" " " "${txt_end}"
17-
echo -e "${bg_red}${txt_white} You are not currently in a Magento directory ${txt_end}"
18-
echo -e "${bg_red}${txt_white} ${txt_end}"
16+
printf '%-1s %-78s %-1s' "${bg_red}${txt_white}" " " "${txt_end}"
17+
echo
18+
echo -e "${bg_red}${txt_white} You are not currently in a Magento directory ${txt_end}"
19+
echo -e "${bg_red}${txt_white} ${txt_end}"
1920
exit
2021
fi
2122

2223
# Set global paths and functions
2324
source "${dbsyncutil}set_constants.sh"
2425

25-
echo -e "${bg_black}${txt_white} ${txt_end}"
26-
echo -e "${bg_black}${txt_white} Copy over a production database to staging ${txt_end}"
27-
echo -e "${bg_black}${txt_white} ${txt_end}"
26+
printf '%-1s %-78s %-1s' "${bg_black}${txt_white}" " " "${txt_end}"
27+
echo
28+
echo -e "${bg_black}${txt_white} Copy over a production database to staging ${txt_end}"
29+
echo -e "${bg_black}${txt_white} ${txt_end}"
2830

2931
# Check for a local config file
3032
echo -e ""
@@ -97,6 +99,6 @@ n98-magerun indexer:reindex
9799
echo
98100
n98-magerun cache:flush
99101

100-
echo -e "${bg_green}${txt_white}${txt_bold} ${txt_end}"
101-
echo -e "${bg_green}${txt_white}${txt_bold} Database migrated: ${txt_yellow}${new_domain} ${txt_end}"
102-
echo -e "${bg_green}${txt_white}${txt_bold} ${txt_end}"
102+
echo -e "${bg_green}${txt_white}${txt_bold} ${txt_end}"
103+
printf '%-2s %-76s %-2s' "${bg_green}${txt_white}${txt_bold}" "Database migrated: ${txt_yellow}${new_domain}" "${txt_end}"
104+
echo -e "${bg_green}${txt_white}${txt_bold} ${txt_end}"

example.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ local_backup_dir=/opt/magento/backups
1010
local_shared_deployment_dir=/opt/magento/deployment/shared/magento
1111
local_file_user=magento
1212
local_file_group=magento
13+
ignore_tables="mageplaza_smtp_log"

utils/remote_backup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ REMOTE_DB_WP_DBASE=$(n98-magerun config:env:show db.connection.wordpress.dbname)
2020
if [ $_arg_full == 'on' ]; then
2121
n98-magerun db:dump --compression="gzip" --strip="@log @sessions" --force $remote_backup_dir/latest-m2.sql.gz
2222
else
23-
n98-magerun db:dump --compression="gzip" --strip="@log @sessions @trade @sales" --force $remote_backup_dir/latest-m2.sql.gz
23+
n98-magerun db:dump --compression="gzip" --strip="@log @sessions @trade @sales $ignore_tables" --force $remote_backup_dir/latest-m2.sql.gz
2424
fi
2525
2626
if [ $_arg_wordpress == 'on' ]; then

0 commit comments

Comments
 (0)