Backup DB before any operation.

This commit is contained in:
2025-07-08 12:18:24 -06:00
parent 053fe2dab4
commit 8c4a05e01c
+3
View File
@@ -6,6 +6,9 @@ if ( ! file_exists( 'wp-content/mysql.sql' ) ) {
return;
}
// Create backup of the current database.
echo shell_exec( 'wp db export ./wp-content/mysql-backup.sql' );
$staging_domain = shell_exec( 'wp option get siteurl' );
echo shell_exec( 'wp db import ./wp-content/mysql.sql' );