shawnhooper / delete-orphaned-multisite-tables

Finds and delete orphaned tables in a WordPress Multisite network.
GNU General Public License v3.0
44 stars 6 forks source link

Introduction make me confused #3

Open alexlii1971 opened 5 years ago

alexlii1971 commented 5 years ago

Hello,

Firstly, thanks for your great work.

I read this article, and I found there are lost different upon how to use it:

How can I find orphaned Multisite tables

Run wp multisite-db list from the command-line How can I delete orphaned Multisite tables

Run wp multisite-db delete --force from the command-line

but in that article, there are different ways:

In order to figure out which sites are safe to remove from, we first need a list of all subsites. This can gather by running the following wp-cli command wp site list --format=ids which will output something like 1 2 4 7. Next we need a list of actual upload folders within multisite. On legacy multisite networks this is found under /wp-content/blogs.dir/ for modern networks /wp-content/uploads/sites. From the terminal we can grab a full list by running ls ~/Backup/wp-content/blogs.dir/ which will return something like this: 1 2 3 4 5 6 7 With can take those IDs and parse them using a bash script remove_orphaned_mu_uploads.sh

Running remove_orphaned_mu_uploads.sh will output the following: 3 5 6 which are orphaned upload directories. These folders are safe to delete.

would you please clear upon how to use it?

Secondly,

I already activated it: http://prntscr.com/lluhb9

but, there is errors show up:

root@101:~# wp multisite-db list Warning: No WordPress install found. If the command 'multisite-db list' is in a plugin or theme, pass --path=path/to/wordpress. Error: 'multisite-db' is not a registered wp command. See 'wp help' for available commands. root@101:~#

does it support wordpress 4.9.8?

Thanks

jhaeger commented 1 year ago

Hi @alexlii1971 ,

Man, time flies, doesn't it? I found this plugin today, 5 years after your comment.

I'm running WordPress 6.3 and php7.4 on a multisite install of 284 sites.

It works just like the README says.

Upload the plugin. Activate the plugin.

Then SSH into your site (if your host doesn't offer SSH access, bad host!).

If you cannot SSH into your site, then you're out of luck, unless you can ask your host to run a command on your server for you.

image

The image is a screenshot of a completed run. I appreciate your quick tip on pulling down a list of sites! It made me feel a lot better looking at the list created by the plugin (orphaned sites) and the list created by wp-cli native (all active sites) to make sure active sites were not accidentally marked as orphaned. (none were).

The plugin adds WP CLI functionality, but if the plugin isn't installed and active, the command doesn't exist. (which is what you got with "Error: 'multisite-db' is not a registered wp command."

It is an added command by the plugin. Activate the plugin first, then SSH into your host, and run $ wp multisite-db list to compare to your $ wp site list format=ids list to give you piece of mind. When ready, just run $ wp multisite-db delete --force.

It's possible that your SSH isn't to the proper directory. That might be something to ask your host about.