Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating delete all WP files #34

Open
GioPetry opened this issue Apr 3, 2024 · 5 comments
Open

Updating delete all WP files #34

GioPetry opened this issue Apr 3, 2024 · 5 comments

Comments

@GioPetry
Copy link

GioPetry commented Apr 3, 2024

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
Copy link

lkraav commented Apr 8, 2024

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

@mralexho
Copy link

@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
Copy link
Author

@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
Copy link

@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
Copy link
Author

@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

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

No branches or pull requests

3 participants