SQLITE_READONLY_DBMOVED: database file moved while open
The database file was moved, renamed or deleted after it was opened, so SQLite refuses to write to it to avoid corrupting it.
- Result code
SQLITE_READONLY_DBMOVED- Name
1032- Category
- Extended result codes
What it means
SQLITE_READONLY_DBMOVED (1032) means the database can't be modified because the file has moved since it was opened. If SQLite kept writing and the process crashed, its rollback journal would sit under the old name and couldn't be used to repair the file, so it stops writes instead.
Common causes
- Renaming, moving or replacing the database file while a program has it open.
- Deleting the file (for example a cleanup job or a test teardown) while a connection is still open.
- Atomic file replacement by deployment or sync tools.
How to fix it
-
Close all connections before moving or replacing the file, then reopen it at the new path.
-
To swap in a new database, restore into the open connection with the backup API instead of replacing the file on disk.
Related errors
More extended result codes errors
SQLITE_ERROR_MISSING_COLLSEQno such collation sequenceSQLITE_BUSY_RECOVERYanother process is recovering the WALSQLITE_LOCKED_SHAREDCACHErecord locked in shared cacheSQLITE_CONSTRAINT_CHECKCHECK constraint failedSQLITE_ABORT_ROLLBACKstatement aborted by ROLLBACKSQLITE_BUSY_SNAPSHOTstale read can't become a writeSQLITE_IOERR_SHORT_READread returned fewer bytesSQLITE_CANTOPEN_ISDIRthe path is a directory
The code and message text are from the SQLite result and error codes documentation. Browse the full SQLite error list or search every database error.
Work on SQLite in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for SQLite and the other databases you use.