watchfulli / XCloner-Wordpress

Backup and Restore Plugin for Wordpress
https://wordpress.org/plugins/xcloner-backup-and-restore/
GNU General Public License v2.0
92 stars 28 forks source link

Issue backing up wp-content #301

Open AdamJSoftware opened 8 months ago

AdamJSoftware commented 8 months ago

I am running wordpress inside a bitnami container. It seems that XCloner doesn't recognise wp-content (doesn't even show in the section where you can choose which folders to ignore). My guess is that bitnami uses a symbolic link to connect the wp-content folder and this confuses xcloner. Is this something that can be fixed?

Nox-404 commented 2 months ago

Can confirm, The lib used to read the filesystem doesn't support symlinks.

The plugin cannot backup bitnami's wp-content folder & wp-config.php file...

Local fs adapter initialization: https://github.com/watchfulli/XCloner-Wordpress/blob/master/xcloner-backup-and-restore/lib/Xcloner_Filesystem.php#L84

Local fs adapter code: https://github.com/thephpleague/flysystem/blob/3.x/src/Local/LocalFilesystemAdapter.php#L52-L60 - symlink handling flags https://github.com/thephpleague/flysystem/blob/3.x/src/Local/LocalFilesystemAdapter.php#L217-L222 - symlink handling (skip or throw)

Symlink support has been denied: https://github.com/thephpleague/flysystem/issues/599

So either create a new local adapter supporting symlinks, or maybe allow to include other arbitrary folders (in that case /bitnami/wordpress/... alongside the wp root directory /opt/bitnami/wordpress/) ?

Nox-404 commented 2 months ago

I managed to work around it using this command inside the container: wp option add xcloner_start_path '/bitnami/wordpress'

Then I deactivated/activated the plugin and now it sees the mounted volume instead of wordpress root (which shouldn't need backup anyway as it's in the container's image)