laurent22/joplin · critical · Error
Unknown profile version. Most likely this is an old version
Error message
Unknown profile version. Most likely this is an old version of Joplin, while the profile was created by a newer version. Please upgrade Joplin at https://joplinapp.org and try again.
Joplin version: ${shim.appVersion()}
Profile version: ${fromVersion}
Expected version: ${existingDatabaseVersions[existingDatabaseVersions.length - 1]} What it means
Thrown by JoplinDatabase migration logic when fromVersion (the profile's recorded schema version) is not in existingDatabaseVersions. existingDatabaseVersions is the base list [0..41] extended by each migration. An unknown fromVersion means the running Joplin is older than the one that created the profile; rather than silently corrupt data, Joplin refuses to start.
Source
Thrown at packages/lib/JoplinDatabase.ts:410
// IMPORTANT:
//
// Whenever adding a new database property, some additional logic might be needed
// in the synchronizer to handle this property. For example, when adding a property
// that should have a default value, existing remote items will not have this
// default value and thus might cause problems. In that case, the default value
// must be set in the synchronizer too.
// Note: v16 and v17 don't do anything. They were used to debug an issue.
const existingDatabaseVersions = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41];
for (let i = 0; i < migrations.length; i++) existingDatabaseVersions.push(existingDatabaseVersions[existingDatabaseVersions.length - 1] + 1);
let currentVersionIndex = existingDatabaseVersions.indexOf(fromVersion);
// currentVersionIndex < 0 if for the case where an old version of Joplin used with a newer
// version of the database, so that migration is not run in this case.
if (currentVersionIndex < 0) {
throw new Error(
'Unknown profile version. Most likely this is an old version of Joplin, while the profile was created by a newer version. Please upgrade Joplin at https://joplinapp.org and try again.\n'
+ `Joplin version: ${shim.appVersion()}\n`
+ `Profile version: ${fromVersion}\n`
+ `Expected version: ${existingDatabaseVersions[existingDatabaseVersions.length - 1]}`);
}
this.logger().info(`Upgrading database from version ${fromVersion}`);
if (currentVersionIndex === existingDatabaseVersions.length - 1) return fromVersion;
let latestVersion = fromVersion;
while (currentVersionIndex < existingDatabaseVersions.length - 1) {
const targetVersion = existingDatabaseVersions[currentVersionIndex + 1];
this.logger().info(`Converting database to version ${targetVersion}`);
let queries: (SqlQuery|string)[] = [];
View on GitHub (pinned to 2654b33620)
Solutions
- Upgrade Joplin to at least the version that created the profile (the error prints the expected version) — https://joplinapp.org.
- If you must run the older version, use a separate fresh profile (`--profile /path/to/new`) so the newer profile is not corrupted.
- Do not manually edit the profile version table — let Joplin migrate it.
Example fix
# before: joplin --version 2.10 opens a profile last opened by 2.14 # after: upgrade sudo snap refresh joplin # or download the newer AppImage joplin
Defensive patterns
Strategy: try-catch
Validate before calling
// Outside Joplin (tooling), detect a version mismatch before launch by reading the profile DB. // Inside Joplin there is no pre-check — the guard itself is the check.
Type guard
const isKnownProfileVersion = (v, known) => Number.isInteger(v) && known.includes(v);
Try / catch
try { await db.migrate(); }
catch (e) { if (/Unknown profile version/.test(e.message)) { /* prompt user to upgrade Joplin, do not attempt manual migration */ } else throw e; } Prevention
- Always upgrade Joplin; never downgrade against a newer profile.
- If you need to test an older build, use a separate profile directory via --profile.
When it happens
Trigger: User opens a profile created/last-opened by a NEWER Joplin build with an OLDER build — currentVersionIndex = existingDatabaseVersions.indexOf(fromVersion) returns -1.
Common situations: Downgrading Joplin after running a beta or a newer stable; copying a profile from a newer install to an older one; running an older AppImage against a synced profile.
Related errors
AI-assisted analysis of laurent22/joplin@2654b33620 (2026-08-12).
Data as JSON: /api/errors/aec6cd997de0540e.
Report an issue: GitHub.