Skip to content

Commit be13167

Browse files
committed
Merge branch 'develop' for v3.5.3
2 parents 33a11a3 + 4e5842f commit be13167

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/helper/Site_Backup_Restore.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ private function backup_php_wp( $backup_dir ) {
362362
private function backup_db( $backup_dir ) {
363363
// Flush MySQL privileges before backup
364364
if ( 'running' === \EE_DOCKER::container_status( GLOBAL_DB_CONTAINER ) ) {
365-
EE::exec( 'docker exec -it ' . GLOBAL_DB_CONTAINER . " bash -c 'mysql -uroot -p\$MYSQL_ROOT_PASSWORD -e\"FLUSH PRIVILEGES\"'" );
365+
EE::exec( 'docker exec -it ' . GLOBAL_DB_CONTAINER . " bash -c 'mysql --skip-ssl -uroot -p\$MYSQL_ROOT_PASSWORD -e\"FLUSH PRIVILEGES\"'" );
366366
}
367367

368368
EE::log( 'Backing up database.' );
@@ -463,7 +463,7 @@ private function restore_db( $sql_file, $container_path ) {
463463
$sql_path = "/var/www/$container_path/" . basename( $sql_file ); // Use basename for safety
464464

465465
// Corrected command with proper escaping and error suppression for password
466-
$restore_command = sprintf( "mysql -u '%s' -p'%s' -h '%s' '%s' < '%s' 2>/dev/null", $db_user, $db_password, $db_host, $db_name, $sql_path );
466+
$restore_command = sprintf( "mysql --skip-ssl -u '%s' -p'%s' -h '%s' '%s' < '%s' 2>/dev/null", $db_user, $db_password, $db_host, $db_name, $sql_path );
467467

468468
$args = [ 'shell', $site_url ];
469469
$assoc_args = [ 'command' => $restore_command ];
@@ -775,7 +775,7 @@ private function get_db_size() {
775775
$this->fs->dumpFile( $query_file, $query );
776776

777777

778-
$command = sprintf( "mysql -u %s -p%s -h %s %s < /var/www/htdocs/db_size_query.sql", $user, $password, $host, $db_name );
778+
$command = sprintf( "mysql --skip-ssl -u %s -p%s -h %s %s < /var/www/htdocs/db_size_query.sql", $user, $password, $host, $db_name );
779779

780780
$output = EE::launch( "ee shell " . $this->site_data['site_url'] . " --skip-tty --command=\"$command\"" );
781781

0 commit comments

Comments
 (0)