File tree Expand file tree Collapse file tree 5 files changed +10
-8
lines changed Expand file tree Collapse file tree 5 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -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.1 /install.sh | bash ```
18
+ ``` curl -o- https://raw.githubusercontent.com/clivewalkden/bash-magento2-db-sync/master /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 @@ -13,7 +13,7 @@ source "${dbsyncutil}menu.sh"
13
13
14
14
# Make sure we are in a Magento directory
15
15
if [ ! -f " bin/magento" ]; then
16
- echo -e " ${bg_red}${txt_white} ${txt_end} "
16
+ printf ' %-1s %-80s %-1s ' " ${bg_red}${txt_white} " " " " ${txt_end} "
17
17
echo -e " ${bg_red}${txt_white} You are not currently in a Magento directory ${txt_end} "
18
18
echo -e " ${bg_red}${txt_white} ${txt_end} "
19
19
exit
Original file line number Diff line number Diff line change @@ -10,6 +10,6 @@ source=("/pub/media/" "/wp/wp-content/uploads/")
10
10
dest=(" ${local_shared_deployment_dir} /pub/media/" " ${local_shared_deployment_dir} /wp/wp-content/uploads/" )
11
11
12
12
for i in " ${! source[@]} " ; do
13
- rsync -rlDhP --exclude ' cache*' -e " ssh -p${remote_port} " " $remote_username @$remote_host :$remote_shared_deployment_dir ${source[$i]} " " ${dest[$i]} "
14
- chown -R $local_file_user :$local_file_group " ${dest[$i]} "
13
+ rsync --recursive --links --human-readable --partial --progress --compress --perms --exclude ' cache*' -e " ssh -p${remote_port} " " $remote_username @$remote_host :$remote_shared_deployment_dir ${source[$i]} " " ${dest[$i]} "
14
+ sudo chown -R $local_file_user :$local_file_group " ${dest[$i]} "
15
15
done
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
- version=" 1.4.1 "
2
+ version=" 1.4.2-dev "
3
3
4
4
die ()
5
5
{
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ new_domain=$(printf '%s' "${new_domain}" | sed 's/^https:\/\///g')
16
16
new_domain=$( printf ' %s' " ${new_domain} " | sed ' s/^:\/\///g' )
17
17
# remove //
18
18
new_domain=$( printf ' %s' " ${new_domain} " | sed ' s/^\/\///g' )
19
+ # remove www.
20
+ new_domain=$( printf ' %s' " ${new_domain} " | sed ' s/^www\.//g' )
19
21
# trim multiple and trailing slashes
20
22
new_domain=$( echo ${new_domain} | sed ' s:/*$::' )
21
23
@@ -31,13 +33,13 @@ old_domain=$(printf '%s' "${old_domain}" | sed 's/^\/\///g')
31
33
# trim multiple and trailing slashes
32
34
old_domain=$( echo ${old_domain} | sed ' s:/*$::' )
33
35
34
- echo -e " ${txt_blue} Old Domain: ${old_domain} to New Domain: ${new_domain} .${txt_end} "
36
+ echo -e " ${txt_blue} Old Domain: (www.) ${old_domain} to New Domain: ${new_domain} .${txt_end} "
35
37
echo -e " "
36
38
37
- sed -i " s|$old_domain |$new_domain |g" " ${local_backup_dir} /latest-m2.sql"
38
39
sed -i " s|www.$old_domain |$new_domain |g" " ${local_backup_dir} /latest-m2.sql"
40
+ sed -i " s|$old_domain |$new_domain |g" " ${local_backup_dir} /latest-m2.sql"
39
41
40
42
if [ $_arg_wordpress == ' on' ]; then
41
- sed -i " s|$old_domain |$new_domain |g" " ${local_backup_dir} /latest-wp.sql"
42
43
sed -i " s|www.$old_domain |$new_domain |g" " ${local_backup_dir} /latest-wp.sql"
44
+ sed -i " s|$old_domain |$new_domain |g" " ${local_backup_dir} /latest-wp.sql"
43
45
fi
You can’t perform that action at this time.
0 commit comments