• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Issue Replace a folder and all contents rather than replace changed files?

thinkjarvis

Basic Pleskian
Server operating system version
Ubuntu 22.04.4 LTS
Plesk version and microupdate number
Version 18.0.59 Update #2
Hi we are trying to recover from a malware attack on a specific website (Not one I coded thank goodness!)

I am trying to manually replace wordpress files and folders with an original copy from the wordpress repository.

I want to do the following in the least disruptive way possible:
If I put a random file in wp-admin folder
upload a fresh zipped copy of wp-admin folder and select overwrite existing files
the random file is still there because it wasnt in the fresh zip copy

I am trying to remove files that shouldnt be there so I need to replace an entire folder and its contents not just replace files that existing the new zip.

If I cannot do this in an 'automated' way then I'll have to delete the original folder and then unzip the new one.
This will disrupt the site.

Any ideas how I can replace an entire folder and files rather than only replacing the individual files that have been changed?
 
The question is can I replace an entire folder including files that arent present in the new folder.

If you extract a zip file from the file manager it replaces files that are present but does not delete items that arent present.

I am trying to remove malicious files that shouldnt be there by replacing entire folders with the original copies from source.

So the question isnt how to remove an entire folder before restoring it
Im trying to avoid downtime - Deleting the folder first would break things so I just want to replace the entire folder to get rid of files that shouldnt be there.

A standard extract files command from plesk interface doesnt remove files that arent present in the new copy.
 
You cannot directly unzip and auto-remove files that are not part of the zip. You will need to remove the folder first.
 
Back
Top