Seravo / seravo-plugin

Enhances WordPress with Seravo specific features and integrations
https://seravo.com/
GNU General Public License v2.0
38 stars 16 forks source link

Button to reset the site #33

Open mikkohopia opened 7 years ago

mikkohopia commented 7 years ago

Button to reset the site to the default install. The button should be in "safe" place and maybe ask password confirmation before reseting the site. I use my mikkohopia.fi site as a demo environment for new projects so this feature would be handy.

ottok commented 7 years ago

We don't have a "template" site or stage of the sites where they could "reset to". Databases or files cannot be deleted and reinstalled automatically because the original admin passwords or site admin emails are not stored anywhere.

This issue needs more implementation design.

l3ku commented 6 years ago

Is this issue still relevant today amongst our customers? We do provide wp-shadow-reset (and most likely wp-shadow-pull in the future) so do we actually need a "factory reset" button for production?

mikkohopia commented 6 years ago

I have not missed this feature recently. So I think this is not that important feature anymore.

karisavolainen commented 6 years ago

This set of commands resets the site pretty close to the right-after-install state.

  1. TAKE BACKUP! wp-backup

  2. Run the following commands to empty content from DB, delete plugins, themes and uploads and to reinstall default theme and plugins:

echo "truncate table wp_posts; truncate table wp_comments; truncate table wp_commentmeta; truncate table wp_links; truncate table wp_terms; truncate table wp_termmeta;" | mysql

cd ~/htdocs/wp-content
rm -rf themes/*
wp theme install --activate twentyseventeen

rm -rf plugins/*
wp plugin install auto-post-thumbnail google-analytics-dashboard-for-wp

rm -rf uploads/*
wp-purge-cache
karisavolainen commented 6 years ago

The users are not removed and WordPress widgets are stored in wp_options table which we probably don't want to delete.

ottok commented 6 years ago

This became now possible for new sites thanks to the saving of the /data/db/*.sql.orig files then deploying new sites (thanks to @l3ku).

l3ku commented 6 years ago

Note that if relying on /data/db/*.sql.orig files, this feature will never work for old sites. The functionality should probably first check the existence of those types of files, and only load the site reset UI if such original database file exists.

elguitar commented 3 years ago

Seravo's Customer Success team reported that there are cases, where this would be helpful.

More information about the reset process: https://help.seravo.com/article/63-resetting-your-site-to-an-empty-wordpress-installation

ottok commented 3 years ago

The page linked above in English is outdated. A easier method is documented at https://help.seravo.fi/article/194-wordpress-sivuston-tyhjentaminen-kokonaan and the Seravo Plugin could maybe trigger it, but I am not sure how the execution would complete as importing the old database would delete sessions and throw user out from wp-admin anyway and so on.