ether / etherpad-lite

Etherpad: A modern really-real-time collaborative document editor.
http://docs.etherpad.org/
Apache License 2.0
16.11k stars 2.8k forks source link

How to delete a pad when you can't use the admin interface #6302

Closed nono-lqdn closed 2 months ago

nono-lqdn commented 2 months ago

Describe the bug

Because of several limitations of the admin interface of etherpad, you may encounter a situation where you have too many pads to delete or edit them through the admin interface, using the ep_adminpads_2 plugin, because the query times out with the Error: Query inactivity timeout error message.

See : https://github.com/ether/ep_adminpads2/issues/25

Because of that, you may need to delete the pad via the API. Here are the steps you should follow.

Please not that if you don't know the pad's ID ( which is everything after the /p/ part of the URL, i.e; pad.example.com/p/this-is-the-pad-id ), you will have the visit each pad. Good luck with that.

To Reproduce Steps to reproduce the behavior:

  1. Find your Etherpad's API Key. It should be in the API_KEY.txt file in your etherpad installation.
  2. Find you Etherpad's API version. It should be display when you visit the pad.example.org/api/ page.
  3. Optional - Connect to your server and run the follow command to get your pad's ID if needed : mysql etherpad -e "select \key` from store where `key` like 'pad:%' and `key` not like '%:%:%';" | grep "a word I know is in the pad's URL"` 3.1. You can know run the following command :
ETHERPAD_HOST='https://pad.example.ch'; ETHERPAD_API_KEY='your-API-key'; ETHERPAD_API_VERSION='your-api-version'; curl -s -X GET "${ETHERPAD_HOST}/api/${ETHERPAD_API_VERSION}/deletePad?apikey=${ETHERPAD_API_KEY}&padID=your-pad-id"

You need to replace the values of ETHERPAD_HOST , ETHERPAD_API_KEY, ETHERPAD_API_VERSION, and padID

You should get this answer :

{"code":0,"message":"ok","data":null}% 

Also note that if your pad's ID contains non-ascii characters ( for example é è ê or any similar character ), you will need to replace it by it's percent-encoded version .

The wiki may help you : https://etherpad.org/doc/v2.0.1/#_deletepadpadid

This can and maybe should be added to the wiki. It's more of a not for myself in the futur and anyone it might help.

SamTV12345 commented 2 months ago

Try updating to Etherpad 2.1. That issue should be solved with 2.1