Recreate app DB in SQL

I need to recreate the DB for the app NEWS, rows has been removed when the app was unistalled and removed.

when reinstalling the app it will not recreate the missing rows.

so how do you go about doing that?

Would it be possible that you want to recreate the database tables of the News app, because columns are missing? Please make sure that all app related data have been removed on uninstall from the Nextcloud database BEFORE reinstalling the app.

This posting describes what need to be done to clean-up the database if e.g. the Mail app has been removed. It should be an easy task to adapt the steps for the news app. Please make sure that you’re creating a database backup before you modify any data:

Thank you for your reply.

i have done this steps, i normaly have pretty good controll of the db, but the news app did not want to create new db rows upon install anyway.

to resolv this i was forced to create the rows manualy.

1 Like

Yes the core keep track of it with the entrys in the mentioned db appconfig. But deleting it with all references in db to news and files on storage didnt make any changes.

Nextcloud realy has some issues that needs to be resolved in regards to cleanup, my instanse is old, and the db is full of crap from old apps not even available today, also alot of crap from owncloud before i switched to nc.

I currently have the same issue with the NEWS app on a new nextcloud install. All I wanted to do to start with was remove an rss feed url that was returning a 404 error, since there is no way to “unsubscribe”, much less from a feed that went mia. Ultimately I ended up deleting the entire folder it was in via the web interface to try and get rid of it (figuring I could recreate it and readd all the other feeds), but when I tried to readd the folder and the other feeds in it, I kept getting errors about the feeds already being subscribed. However they were not available and nowhere to be seen.

So my next brilliant idea was to go plumbing around the database to see if I could fix the problem. Stupidly without doing a backup dump first. I tried toggling the folder’s deleted column. No luck. I tried toggling the feed’s deleted columns. No luck. I tried deleting the rows. No luck. I tried uninstalling the app completely via nextcloud, and reinstalling. No luck. I finally decided after a 3rd attempt at uninstalling, to nuke the database tables for the app which were still present in spite of the app supposedly being “removed”.

Now … I cannot reinstall the app. I mean it says it’s installed, but it will not recreate the database structure no matter what I’ve tried. This is extremely frustrating, as I had high hopes for this app. But now it’s completely broken and I can’t even find a simple SQL schema which might help resolve the problem and restore the app to factor defaults. All this because I wanted to unsubscribe from a single broken/missing rss feed.

I encountered the exact same problem as you. A issue on the github repo seems to have a solution: After reset, News App is not working · Issue #838 · nextcloud/news · GitHub.
Perform the following steps:

  1. Disable and remove news app
  2. Remove all settings in the db: DELETE FROM oc_appconfig WHERE appid = ‘news’;
  3. Remove all migrations in the db: DELETE FROM oc_migrations WHERE app = ‘news’;
  4. Reinstall and Enable news app.

Caution: Please be careful when tinkering with the db and always perform a backup beforehand.