Skip to content

Commit 316d1e8

Browse files
committed
Updated version number to make sure we see the changes on the test system.
Updated rsync flags passed. Removing www from new url before replacement. Updated readme to use master branch for installation.
1 parent aa1627f commit 316d1e8

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Currently the script is configured to attempt Magento 2 and WordPress database m
1515
## Installing and Updating
1616
To install or update the script run the following curl script
1717

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```
1919

2020
## Usage
2121
To copy over a production database first get a shell on the system you want to copy the data to.

db-sync.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ source "${dbsyncutil}menu.sh"
1313

1414
# Make sure we are in a Magento directory
1515
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}"
1717
echo -e "${bg_red}${txt_white} You are not currently in a Magento directory ${txt_end}"
1818
echo -e "${bg_red}${txt_white} ${txt_end}"
1919
exit

utils/local_imagery_import.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ source=("/pub/media/" "/wp/wp-content/uploads/")
1010
dest=("${local_shared_deployment_dir}/pub/media/" "${local_shared_deployment_dir}/wp/wp-content/uploads/")
1111

1212
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]}"
1515
done

utils/menu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
version="1.4.1"
2+
version="1.4.2-dev"
33

44
die()
55
{

utils/url_update.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ new_domain=$(printf '%s' "${new_domain}" | sed 's/^https:\/\///g')
1616
new_domain=$(printf '%s' "${new_domain}" | sed 's/^:\/\///g')
1717
# remove //
1818
new_domain=$(printf '%s' "${new_domain}" | sed 's/^\/\///g')
19+
# remove www.
20+
new_domain=$(printf '%s' "${new_domain}" | sed 's/^www\.//g')
1921
# trim multiple and trailing slashes
2022
new_domain=$(echo ${new_domain} | sed 's:/*$::')
2123

@@ -31,13 +33,13 @@ old_domain=$(printf '%s' "${old_domain}" | sed 's/^\/\///g')
3133
# trim multiple and trailing slashes
3234
old_domain=$(echo ${old_domain} | sed 's:/*$::')
3335

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}"
3537
echo -e ""
3638

37-
sed -i "s|$old_domain|$new_domain|g" "${local_backup_dir}/latest-m2.sql"
3839
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"
3941

4042
if [ $_arg_wordpress == 'on' ]; then
41-
sed -i "s|$old_domain|$new_domain|g" "${local_backup_dir}/latest-wp.sql"
4243
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"
4345
fi

0 commit comments

Comments
 (0)