Skip to content

Commit a0903c4

Browse files
committed
Auto-detect URLs for db clone search-replace
1 parent 5d0ea74 commit a0903c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Models/Environment.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ public function cloneDatabase(Environment $from_env, array $options = [])
176176
if (!empty($options['from_url']) && !empty($options['to_url'])) {
177177
$params['wp_replace_siteurl']['from_url'] = $options['from_url'];
178178
$params['wp_replace_siteurl']['to_url'] = $options['to_url'];
179+
} else {
180+
// Automatically detect environment URLs for search-replace
181+
$params['wp_replace_siteurl']['from_url'] = 'https://' . $from_env->domain();
182+
$params['wp_replace_siteurl']['to_url'] = 'https://' . $this->domain();
179183
}
180184
return $this->getWorkflows()->create(
181185
'clone_database',

0 commit comments

Comments
 (0)