Mass deleting Nextcloud bookmarks

25-04-2018 - 2 minutes, 18 seconds -

Since Xmarks is shutting down on May 1, 2018, I started experimenting with nextcloud bookmarks. Unfortunately, I did not realize that bookmark folders are not supported: https://github.com/nextcloud/bookmarks/issues/13

I wanted to start over, but there was no way to mass delete bookmarks through the web interface. Instead, I deleted them from the database:

Log into the database:

mysql -u root -p

List databases:

show databases;
MariaDB [nextclouddb]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| nextclouddb        |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)

USE nextclouddb;
MariaDB [nextclouddb]> show tables;
+---------------------------------+
| Tables_in_nextclouddb           |
+---------------------------------+
| oc_accounts                     |
| oc_activity                     |
| oc_activity_mq                  |
| oc_addressbookchanges           |
| oc_addressbooks                 |
| oc_admin_sections               |
| oc_admin_settings               |
| oc_appconfig                    |
| oc_authtoken                    |
| oc_bookmarks                    |
| oc_bookmarks_tags               |
| oc_bruteforce_attempts          |
| oc_calendarchanges              |
| oc_calendarobjects              |
| oc_calendarobjects_props        |
| oc_calendars                    |
| oc_calendarsubscriptions        |
| oc_cards                        |
| oc_cards_properties             |
| oc_comments                     |
| oc_comments_read_markers        |
| oc_credentials                  |
| oc_dav_shares                   |
| oc_federated_reshares           |
| oc_file_locks                   |
| oc_filecache                    |
| oc_files_trash                  |
| oc_flow_checks                  |
| oc_flow_operations              |
| oc_group_admin                  |
| oc_group_user                   |
| oc_groups                       |
| oc_jobs                         |
| oc_migrations                   |
| oc_mimetypes                    |
| oc_mounts                       |
| oc_notes_meta                   |
| oc_notifications                |
| oc_notifications_pushtokens     |
| oc_oauth2_access_tokens         |
| oc_oauth2_clients               |
| oc_passman_credentials          |
| oc_passman_delete_vault_request |
| oc_passman_files                |
| oc_passman_revisions            |
| oc_passman_share_request        |
| oc_passman_sharing_acl          |
| oc_passman_vaults               |
| oc_personal_sections            |
| oc_personal_settings            |
| oc_preferences                  |
| oc_privatedata                  |
| oc_properties                   |
| oc_schedulingobjects            |
| oc_share                        |
| oc_share_external               |
| oc_storages                     |
| oc_systemtag                    |
| oc_systemtag_group              |
| oc_systemtag_object_mapping     |
| oc_talk_participants            |
| oc_talk_rooms                   |
| oc_talk_signaling               |
| oc_trusted_servers              |
| oc_twofactor_backupcodes        |
| oc_users                        |
| oc_vcategory                    |
| oc_vcategory_to_object          |
+---------------------------------+
68 rows in set (0.01 sec)
MariaDB [nextclouddb]> describe oc_bookmarks;
+--------------+------------------+------+-----+---------+----------------+
| Field        | Type             | Null | Key | Default | Extra          |
+--------------+------------------+------+-----+---------+----------------+
| id           | int(11)          | NO   | PRI | NULL    | auto_increment |
| url          | varchar(4096)    | NO   |     |         |                |
| title        | varchar(4096)    | NO   |     |         |                |
| user_id      | varchar(64)      | NO   |     |         |                |
| description  | varchar(4096)    | NO   |     |         |                |
| public       | smallint(6)      | YES  |     | 0       |                |
| added        | int(10) unsigned | YES  |     | 0       |                |
| lastmodified | int(10) unsigned | YES  |     | 0       |                |
| clickcount   | int(10) unsigned | NO   |     | 0       |                |
+--------------+------------------+------+-----+---------+----------------+
9 rows in set (0.01 sec)
MariaDB [nextclouddb]> truncate oc_bookmarks;
Query OK, 0 rows affected (0.04 sec)

MariaDB [nextclouddb]> truncate oc_bookmarks_tags;
Query OK, 0 rows affected (0.06 sec)