Skip to content

Conversation

@rodrigo-gpereira
Copy link

@rodrigo-gpereira rodrigo-gpereira commented Nov 16, 2025

This change fixes a bug in the copy_site_files() function where the wp-config.php file from the remote site was copied and overwritten the local wp-config.php file when the remote site had a custom public directory.

Evidence:

sudo ee site clone [email protected]:custom-public.local .

Checking access to both sites
Creating site. This may take a while...
Syncing files
Syncing database
Exporting database from source
Copying database to destination
Importing database in destination
Error: Error while executing clone-import-db. closure: Unable to import database on destination. Please check for file system permissions and disk space.
Cleanup export file from source and destination
Success: Site cloned successfully.
You have to do these additional configurations manually (if required):
1. Update wp-config.php.
2. Add alias domains. 

Problem.

The code only had --exclude '/wp-config.php' (in the root)
When the remote site had a custom source_public_path (e.g., /current/web), wp-config.php was located in /current/wp-config.php
Since the exclusion only covered the root (/wp-config.php), rsync copied wp-config.php from the remote site, overwriting the local database settings and preventing synchronization from occurring correctly.

Solution.

With the code update, it's possible to clone WordPress sites from remote servers with a customized public directory.

sudo ee site clone [email protected]:custom-public.local .

Checking access to both sites
Creating site. This may take a while...
Syncing files
Syncing database
Exporting database from source
Copying database to destination
Importing database in destination
Executing search-replace
Cleanup export file from source and destination
+--------------------+-------------------------------------------+
| Site               | http://custom-public.local                |
+--------------------+-------------------------------------------+
| Site Root          | /opt/easyengine/sites/custom-public.local |
+--------------------+-------------------------------------------+
| Site Title         | custom-public.local                       |
+--------------------+-------------------------------------------+
| WordPress Username | wp-user-o42y                              |
+--------------------+-------------------------------------------+
| WordPress Password | wV0zQVq9Z3Jdgt2yA5                        |
+--------------------+-------------------------------------------+
| Alias Domains      | None                                      |
+--------------------+-------------------------------------------+
| DB Host            | global-db                                 |
+--------------------+-------------------------------------------+
| DB Name            | custom_public_local                       |
+--------------------+-------------------------------------------+
| DB User            | custom-public.local-kvkz6a                |
+--------------------+-------------------------------------------+
| DB Password        | OhkHGKQH3nGYIBJggN                        |
+--------------------+-------------------------------------------+
| E-Mail             | [email protected]                 |
+--------------------+-------------------------------------------+
| SSL                | Not Enabled                               |
+--------------------+-------------------------------------------+
| Cache              | None                                      |
+--------------------+-------------------------------------------+
| Proxy Cache        | Off                                       |
+--------------------+-------------------------------------------+
Success: Site cloned successfully.
You have to do these additional configurations manually (if required):
1. Update wp-config.php.
2. Add alias domains.

Note: Since the synchronize command uses the same function, the correction covers synchronization from the remote server.

Fixes #463

…site with a custom public directory

This change fixes a bug in the copy_site_files() function where the wp-config.php file from the remote site was copied and overwritten the local wp-config.php file when the remote site had a custom public directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error cloning or synchronizing website from a remote server.

1 participant