• Resolved BooMeranGz

    (@boomerangz)


    Hi,

    When I want to restore a backup of my website, the WP Staging message says:

    This will restore yoyr website! Are you shure?
    – Database will be replaced.
    – Plugins will be added.
    – Themes will be added.
    – Mu-plugins will be added.
    – Media files and images will be added.
    – Plugins will be added.
    – Other file in wp-content folder will be added.

    This restores the site, replacing the data in the database, and adding the website files from the backup.
    This works fine most of the time.

    But in many cases we need to replace absolutely everything, not add files…

    So, how do I do a full restore, which in addition to replacing the database, deletes the current files and replaces them with the files from the backup?

    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Fayyaz

    (@fayyazfayzi)

    Hi @boomerangz ,

    To perform a full restore that replaces all current files with those from the backup, including deleting any existing files, you will need to manually delete the files in your wp-content directory before initiating the restore. WP Staging’s current process adds files, so removing existing ones ensures only the backed-up versions are present.

    Always ensure you have a recent backup before proceeding with such actions.

    For detailed guidance, you may reach out through our support form.

    Cheers
    Fayyaz

    Plugin Contributor Fayyaz

    (@fayyazfayzi)

    Hi @boomerangz ,

    Thank you for your patience. I have confirmed that the restore process in WP Staging is indeed designed to delete existing files before adding new ones from the backup. If you prefer to keep the existing files, you can use the filter available here: WP Staging Actions and Filters.

    We apologize for any confusion caused, and we’ll be updating our popup message to clarify this behavior. If you encounter any issues or if the process doesn’t work as expected, please contact our support team through our dedicated support form, and we’ll assist you promptly.

    Cheers,
    Fayyaz

    Thread Starter BooMeranGz

    (@boomerangz)

    Hi @fayyazfayzi

    I understand that the second answer is valid.

    So finally, according to what you say, the files should be deleted before being restored.

    But I have seen that they are not deleted, for example, if I restore a copy of a wordpress site from the same website, files like wp-config.php are not replaced.

    Is there a filter so that wp-staging replaces absolutely everything?

    Cheers.

    Plugin Author Rene Hermenau

    (@renehermi)

    WP Staging backups and restores all files inside the wp-content folder but does not backup the wordpres core because this is usually not required at all.

    The wp-config.php is the config file and will not be stored inside the backup file for security purposes.
    If you have the assumption your wp core is broken (which should not be possible except you made changes there you can simply download it from the offical wordpress download page and extract and overwrite it by using FTP.

    All the best
    René

    Thread Starter BooMeranGz

    (@boomerangz)

    Hi @renehermi

    But wp-config.php is editable and configurable by the user, and usually each configuration is unique.

    I understand that there must be a way for WP-Staging to save this file and overwrite it on a restore.

    It is understood that if I do a restore, the saved backup worked fine, so I see no reason not to overwrite wp-config.php, on the contrary, it should be rewritten.

    Also, this does not match the previous answers, where I am told that WP-Staging deletes all copies of the files before restoring them…

    If so, then an in-site restore is of no use to us, we must delete everything by hand and start from scratch, which would greatly increase the offline time of each site.

    Saludos.

    Plugin Author Rene Hermenau

    (@renehermi)

    Also, this does not match the previous answers, where I am told that WP-Staging deletes all copies of the files before restoring them…

    Hi boomerangz,

    What my collegue wanted to say was:

    “WP Staging restores all the files that are included in the backup and that are inside wp-content”

    > But?wp-config.php?is editable and configurable by the user, and usually each configuration is unique.

    If you have many different custom changes in your wp-config.php I understand why you want to have that feature but We never had this request before and it’s not very common or better say secure to have that file inside the backup. Reason is if someone gets his hands on the backup file he will also get the DB root password and the salts and can encrypt all users and their passwords from the backup.

    So we decided not to backup that file. Now a backup is save. If we add the wp-config.php to the backup it will not be save any longer without adding another layer of encryption to it.

    WP Staging does not have an option for that but I will discuss with my team how and if this can be implemented.

    Btw. Our pro version has a standalone installer. That can create a wordpress even on a blank server and restore the backup file but even that installer script does not restore a wp-config.php. You just add the database credentials and then the wordpress site will be created automatically and the backup will be restored..

    All the best
    René

    Thread Starter BooMeranGz

    (@boomerangz)

    Hi @renehermi ,

    I’ve tested the standalone installer on a client’s web system with WP-Staging Pro. It’s not very different from how a certain competing plugin works (it won’t be named here), which is fine because it does a full restore from scratch, as it should.

    Any full restore done from WP-Staging should work the same way your standalone installer works.
    In this case, the option of installing a clean WordPress, activating Wp-Staging on the site, uploading a backup and restoring it is very similar.

    But sorry, I don’t find much sense in that previous answer you gave me about security, the “why” certain files are not saved in the backup…

    Security must be handled by each individual, and if the plugin adds more security with an encrypted file, even better (as is the case with WP-Staging and its .wpstg extension), but it should not hinder the work to be done. The “.wpstg” file is already very secure, it cannot be easily reviewed.

    I noticed that the restore also does not replace “functions.php” of the child-theme. But you say that it should completely replace “wp-content/”, so something is not right…

    I understand that for a superficial restore, this form of replacement would be fine, but for a complete restore it is not.

    A complete restore needs to delete absolutely everything, and copy back the files that are in backup, and the same should be done with the database.

    We could skip the “wp-admin” and “wp-includes” folders, but “wp-content” and the files at the “/” level should be completely deleted, there should be no garbage left in a well-done restore.

    I think that they should add to the restore dialog box, the ability to “REPLACE / DELETE” existing files/data.

    Saludos!

    Plugin Contributor Fayyaz

    (@fayyazfayzi)

    We need to investigagte why child theme was not restored as expected. To better assist you with this issue, please fill out our Pro Support form using Pro Support Form Link.

    We appreciate your patience and look forward to resolving this for you.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.