Projet

Général

Profil

Révision f4bff92c

Ajouté par Julien Enselme il y a presque 10 ans

use drush sql-cli to sync databases in d7-sync-site.sh instead of mysql

Voir les différences:

bin/d7-sync-site.sh
5 5
Typically, this script is usefull when you have (or want to have) a test site based on
6 6
a already working site. It relies on bash, drush and drush aliases.
7 7

  
8
Before synching the ssite, the destination site's database is backuped. If the
8
Before synching the site, the destination site's database is backuped. If the
9 9
destination site does not exist, it is created.
10 10

  
11 11
usage: d7-sync.sh SOURCE_SITENAME DEST_SITENAME [--prod]
......
56 56
drush -y @$1 sql-dump --result-file=$sql_file
57 57
sed -i -e "s#https?://assos.centrale-marseille.fr/$1#https://assos.centrale-marseille.fr/$2#g" $sql_file
58 58
sed -i -e "s#/$1/sites/assos.centrale-marseille.fr.$1#/$2/sites/assos.centrale-marseille.fr.$2#g" $sql_file
59
mysql --defaults-extra-file=$myassos_cnf -e "DROP DATABASE IF EXISTS $2; CREATE DATABASE $2"
60
mysql --defaults-extra-file=$myassos_cnf $2 < $sql_file
59
drush @$2 sql-dump | grep DROP | drush sql-cli
60
drush @$2 sql-cli < $sql_file
61 61
rm $sql_file
62 62

  
63 63
## Restore file system

Formats disponibles : Unified diff