seravo-plugin icon indicating copy to clipboard operation
seravo-plugin copied to clipboard

Button to reset the site

Open mikkohopia opened this issue 8 years ago • 9 comments

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.

mikkohopia avatar Mar 20 '17 10:03 mikkohopia

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.

ottok avatar Aug 09 '17 08:08 ottok

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?

l3ku avatar May 02 '18 09:05 l3ku

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

mikkohopia avatar May 02 '18 09:05 mikkohopia

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 avatar Jul 12 '18 10:07 karisavolainen

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

karisavolainen avatar Jul 12 '18 10:07 karisavolainen

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).

ottok avatar Aug 27 '18 07:08 ottok

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.

l3ku avatar Aug 28 '18 15:08 l3ku

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

elguitar avatar Jan 22 '21 08:01 elguitar

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.

ottok avatar Jan 22 '21 09:01 ottok