File tree Expand file tree Collapse file tree 13 files changed +56
-27
lines changed Expand file tree Collapse file tree 13 files changed +56
-27
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
7
7
## [ Unreleased]
8
8
9
+ ## [ 1.4.1] - 2020-09-08
10
+ ### Changed
11
+ - Starting to unify messages.
12
+
13
+ ### Fixed
14
+ - URL switch for WordPress database.
15
+
16
+
9
17
## [ 1.4.0] - 2020-09-02
10
18
### Added
11
19
- wordpress flag (disabled by default) to backup wordpress database and imagery.
Original file line number Diff line number Diff line change 1
- # Magento 2 Production DB Sync v1.4.0
1
+ # Magento 2 Production DB Sync v1.4.1
2
2
3
3
## About
4
4
A script to copy over a production database to another server, also has the ability to copy across imagery.
@@ -15,7 +15,7 @@ Currently the script is configured to attempt Magento 2 and WordPress database m
15
15
## Installing and Updating
16
16
To install or update the script run the following curl script
17
17
18
- ``` curl -o- https://raw.githubusercontent.com/clivewalkden/bash-magento2-db-sync/v1.4.0 /install.sh | bash ```
18
+ ``` curl -o- https://raw.githubusercontent.com/clivewalkden/bash-magento2-db-sync/v1.4.1 /install.sh | bash ```
19
19
20
20
## Usage
21
21
To copy over a production database first get a shell on the system you want to copy the data to.
Original file line number Diff line number Diff line change @@ -27,7 +27,9 @@ echo -e "${bg_black}${txt_white} Copy over a production database to staging ${
27
27
echo -e " ${bg_black}${txt_white} ${txt_end} "
28
28
29
29
# Check for a local config file
30
+ echo -e " "
30
31
echo -e " ${txt_blue} Checking for local configuration file (${conf_file} ). ${txt_end} "
32
+ echo -e " "
31
33
if [[ -f " $conf_file " ]]; then
32
34
. " $conf_file "
33
35
fi
@@ -79,14 +81,12 @@ while true; do
79
81
esac
80
82
done
81
83
82
- echo -e " ${bg_black}${txt_white} ${txt_end} "
83
- echo -e " ${bg_black}${txt_white } Run the Magento configuration. ${txt_end} "
84
- echo -e " ${bg_black}${txt_white} ${txt_end} "
84
+ echo -e " "
85
+ echo -e " ${txt_blue } Run the Magento configuration. ${txt_end} "
86
+ echo -e " "
85
87
86
88
n98-magerun setup:upgrade
87
89
echo
88
- n98-magerun deploy:mode:set developer
89
- echo
90
90
n98-magerun setup:di:compile
91
91
echo
92
92
n98-magerun indexer:reindex
Original file line number Diff line number Diff line change 7
7
}
8
8
9
9
dbsync_latest_version () {
10
- echo " v1.4.0 "
10
+ echo " v1.4.1 "
11
11
}
12
12
13
13
#
Original file line number Diff line number Diff line change 2
2
3
3
if [ $_arg_local_backup == ' on' ]; then
4
4
# Backup the current local database
5
- echo -e " \n${txt_white}${bg_black} Backing up local database(s).${txt_end} \n"
5
+ echo -e " "
6
+ echo -e " ${txt_blue} Backing up local database(s).${txt_end} "
7
+ echo -e " "
6
8
7
- n98-magerun --root-dir=" ${PWD} " db:dump --compression=" gzip" --force " ../backups/$DATESTAMP -m2.sql.gz"
9
+ n98-magerun --ansi -- root-dir=" ${PWD} " db:dump --compression=" gzip" --force " ../backups/$DATESTAMP -m2.sql.gz"
8
10
9
11
if [ $_arg_wordpress == ' on' ]; then
10
- n98-magerun --root-dir=" ${PWD} " db:dump --compression=" gzip" --connection=" wordpress" --force " ../backups/$DATESTAMP -wp.sql.gz"
12
+ n98-magerun --ansi -- root-dir=" ${PWD} " db:dump --compression=" gzip" --connection=" wordpress" --force " ../backups/$DATESTAMP -wp.sql.gz"
11
13
fi
12
14
else
13
15
# No local backup
14
- echo -e " \n${txt_white}${bg_black} Skipping local database(s) backup.${txt_end} \n"
16
+ echo -e " "
17
+ echo -e " ${txt_blue} Skipping local database(s) backup.${txt_end} "
18
+ echo -e " "
15
19
fi
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
# Backup the current local database
4
- echo -e " \n${txt_white}${bg_black} Importing imagery from live.${txt_end} \n"
4
+ echo -e " "
5
+ echo -e " ${txt_blue} Importing imagery from live.${txt_end} "
6
+ echo -e " "
5
7
6
8
# Set the default directories to transfer
7
9
source=(" /pub/media/" " /wp/wp-content/uploads/" )
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
# Backup the current local database
4
- echo -e " \n${txt_white}${bg_black} Importing into local database(s).${txt_end} \n"
4
+ echo -e " "
5
+ echo -e " ${txt_blue} Importing into local database(s).${txt_end} "
6
+ echo -e " "
5
7
6
8
mysql -h$DB_HOST -u$DB_USER -p$DB_PASS $DB_DBASE < ../backups/latest-m2.sql
7
9
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
- version=" 1.4.0 "
2
+ version=" 1.4.1 "
3
3
4
4
die ()
5
5
{
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
# Use the settings to check your connection
4
- echo -e " \n${txt_white}${bg_black} Backing up remote database(s). ${txt_end} \n"
4
+ echo -e " ${bg_black}${txt_white} ${txt_end} "
5
+ echo -e " ${bg_black}${txt_white} Backing up remote database(s). ${txt_end} "
5
6
if [ $_arg_full == ' on' ]; then
6
- echo -e " ${txt_white }${bg_black } Full customer and order backup.${txt_end} \n "
7
+ echo -e " ${bg_black }${txt_white } Full customer and order backup. ${txt_end} "
7
8
fi
9
+ echo -e " ${bg_black}${txt_white} ${txt_end} "
8
10
9
11
ssh -p " ${remote_port} " " ${remote_username} @${remote_host} " << ENDSSH
10
12
mkdir -p $remote_backup_dir
@@ -22,6 +24,6 @@ n98-magerun db:dump --compression="gzip" --strip="@log @sessions @trade @sales"
22
24
fi
23
25
24
26
if [ $_arg_wordpress == 'on' ]; then
25
- n98-magerun db:dump --compression="gzip" --conneciton ="wordpress" --force $remote_backup_dir /latest-wp.sql.gz
27
+ n98-magerun db:dump --compression="gzip" --connection ="wordpress" --force $remote_backup_dir /latest-wp.sql.gz
26
28
fi
27
29
ENDSSH
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
# Use the settings to check your connection
4
- echo -e " \n${txt_white}${bg_black} Retrieving database(s).${txt_end} \n"
4
+ echo -e " "
5
+ echo -e " ${txt_blue} Retrieving database(s).${txt_end} "
6
+ echo -e " "
5
7
6
8
remote_m2_db_file=" $remote_backup_dir /latest-m2.sql.gz"
7
9
remote_wp_db_file=" $remote_backup_dir /latest-wp.sql.gz"
You can’t perform that action at this time.
0 commit comments