johnpbloch / wordpress-core

Other
169 stars 42 forks source link

Updating delete all WP files #34

Open GioPetry opened 6 months ago

GioPetry commented 6 months ago

Hi I use your wp-core package in composer with other packagist plugins to update WP via composer. Today If I do an usual composer update it states: "Upgrading johnpbloch/wordpress-core (6.4.3 => 6.5.0)" After that my wp site is like reinstalled all themes files and plugins are erased Please assist

lkraav commented 6 months ago

You might want to use a higher level abstraction, like https://github.com/wecodemore/wpstarter/

mralexho commented 5 months ago

@GioPetry checkout this package https://github.com/drupal-composer/preserve-paths. You can prevent deletions by adding something like

"preserve-paths": [
    "web/wp-content/themes/custom-theme",
    "web/wp-content/plugins/custom-plugin"
],
GioPetry commented 5 months ago

@GioPetry checkout this package https://github.com/drupal-composer/preserve-paths. You can prevent deletions by adding something like

"preserve-paths": [
    "web/wp-content/themes/custom-theme",
    "web/wp-content/plugins/custom-plugin"
],

@mralexho this can be a good quick solution BUT does it work for files too? at least the wp-config need to be saved...

mralexho commented 5 months ago

@GioPetry yes it works for individual files. Did you see their example? Add the following to your composer file

"preserve-paths": [
    "web/wp-config.php",
    "web/wp-content/themes/custom-theme",
    "web/wp-content/plugins/custom-plugin"
],
GioPetry commented 5 months ago

@GioPetry yes it works for individual files. Did you see their example? Add the following to your composer file

"preserve-paths": [
    "web/wp-config.php",
    "web/wp-content/themes/custom-theme",
    "web/wp-content/plugins/custom-plugin"
],

Thanks but it seems to conflict with the installer see below the message I get. Also I use wpackagist to install and update plugin and themes. Files of installed package were overwritten with preserved path /home/staging/htdocs/mysite/wp-content/themes! Files of installed package were overwritten with preserved path /home/staging/htdocs/mysite/wp-content/plugins!

At the moment the easiest way to work around is is to remove this wp core and installer and use composer just for plugins and themes