Delete all bookmarks from Nextcloud database
Piece of advise
Make a backup before your eyes get wet !
Applies to
This article describes the removal of all bookmarks in Nextcloud when using the Bookmarks app.
https://apps.nextcloud.com/apps/bookmarks
https://github.com/nextcloud/bookmarks
SQLite
Move to Nextcloud data folder
Run the following command
sqlite3 nextcloud.db "delete from oc_bookmarks; delete from oc_bookmarks_tags;"
MySQL
Open MySQL
Snap Package
sudo nextcloud.mysql-client
Docker
Get a prompt inside the container. “mariadb” should be the name of your container if you’re using the official image.
docker exec -it mariadb bash -l
Then run the regular installation login process below
Regular installation
mysql -u root -p
Removing the tables content
Check your database name
show databases;
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| nextcloud |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
Select your nextcloud database
use nextcloud;
Check your tables
show tables;
mysql> show tables;
+-----------------------------------+
| Tables_in_nextcloud |
+-----------------------------------+
| oc_accounts |
| oc_activity |
| oc_activity_mq |
| oc_addressbookchanges |
| oc_addressbooks |
| oc_appconfig |
| oc_authtoken |
| oc_bookmarks |
| oc_bookmarks_folders |
| oc_bookmarks_folders_bookmarks |
| oc_bookmarks_tags |
........
Remove all bookmarks for every users
truncate oc_bookmarks;
mysql> truncate oc_bookmarks;
Query OK, 0 rows affected (0.01 sec)
Remove bookmarks tags for every users
truncate oc_bookmarks_tags;
mysql> truncate oc_bookmarks_tags;
Query OK, 0 rows affected (0.00 sec)
Sources
https://help.nextcloud.com/t/how-to-delete-all-bookmarks/34078
https://github.com/nextcloud/nextcloud-snap#included-cli-utilities
https://stan-bobovych.com/blog/mass-deleting-nextcloud-bookmarks