Jump to content

Manually editing the database


Go to solution Solved by jmos1277,

Recommended Posts

Posted

Is it possible to manually edit the database?
I just attempted to make some changes (after shutting down emby) using "DB Browser for SQLite".
When I restarted my server, I get the error shown below.

Is it possible that my editor produced an invalid output file?
Does emby 'sign' the database to prevent manual edits?

 

SQLitePCL.pretty.SQLiteException: Corrupt: database disk image is malformed
SQLitePCL.pretty.SQLiteException: Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown.
at SQLitePCL.pretty.SQLiteException.CheckOk(sqlite3 db, Int32 rc)
at SQLitePCL.pretty.StatementImpl.MoveNext()
at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItem(IDatabaseConnection db, BaseItem item, Int64 topParentId, Int64 userDataKeyId, IStatement insertItemStatement, IStatement updateItemStatement)
at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItemsInTranscation(IDatabaseConnection db, List`1 tuples, MetadataRefreshOptions metadataRefreshOptions)
at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItems(List`1 items, MetadataRefreshOptions metadataRefreshOptions, Action`1 afterSave, CancellationToken cancellationToken)
Source: SQLitePCL.pretty
TargetSite: Void CheckOk(SQLitePCLEx.sqlite3, Int32)

Happy2Play
Posted

I think it depends on what you are trying to do but hopefully you made a backup first.  But what whatever happened you will have to restore backup or start over.

Corrupt Database : (emby.media)

 

Posted
27 minutes ago, Happy2Play said:

hopefully you made a backup first

lol ... yes.  I made multiple backups.

  • Solution
Posted
34 minutes ago, Happy2Play said:

Corrupt Database : (emby.media)

@Happy2Play, thanks for the link!  
I was wondering if there was some integrity check going on that was preventing me from making manual changes.  After reading through the doc you linked, I was able to just delete the library.db-shm and library.db-wal, restart Emby, and my manual DB changes loaded properly!!

THANKS!!!  

As a side note, since there is no way to automatically LOCK the sort title in the Emby user interface for ALL MediaItems I just did it directly in the DB.  

Happy2Play
Posted
13 minutes ago, jmos1277 said:

As a side note, since there is no way to automatically LOCK the sort title in the Emby user interface for ALL MediaItems I just did it directly in the DB.

Maybe you could make a request to @VicMooreto update his tagging tool to accommodate locking SortName.

A tool for tagging Emby content - Tools and Utilities - Emby Community

But currently this is the only Bulk Editing tool available beside DB or API updates.

 

Posted
4 minutes ago, Happy2Play said:

Maybe you could make a request to @VicMooreto update his tagging tool to accommodate locking SortName.

A tool for tagging Emby content - Tools and Utilities - Emby Community

But currently this is the only Bulk Editing tool available beside DB or API updates.

 

@Happy2Play, thanks for the link.  I wasn't aware of this tool.  I'll have to read up on it since I'm sure I'll find uses for it in the future!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...