{"meta":{"title":"resolve upgrades","intro":"[Deep plumbing] Determine upgrades to run for a raw dataset.","product":"Security and code quality","breadcrumbs":[{"href":"/en/code-security","title":"Security and code quality"},{"href":"/en/code-security/reference","title":"Reference"},{"href":"/en/code-security/reference/code-scanning","title":"Code scanning"},{"href":"/en/code-security/reference/code-scanning/codeql","title":"CodeQL"},{"href":"/en/code-security/reference/code-scanning/codeql/codeql-cli-manual","title":"CodeQL CLI manual"},{"href":"/en/code-security/reference/code-scanning/codeql/codeql-cli-manual/resolve-upgrades","title":"resolve upgrades"}],"documentType":"article"},"body":"# resolve upgrades\n\n[Deep plumbing] Determine upgrades to run for a raw dataset.\n\n> [!NOTE]\n> This content describes the most recent release of the CodeQL CLI. For more information about this release, see https://github.com/github/codeql-cli-binaries/releases.\n>\n> To see details of the options available for this command in an earlier release, run the command with the <span style=\"white-space: nowrap;\">`--help`</span> option in your terminal.\n\n## Synopsis\n\n```shell copy\ncodeql resolve upgrades --dbscheme=<file> <options>...\n```\n\n## Description\n\n\\[Deep plumbing] Determine upgrades to run for a raw dataset.\n\nDetermine which upgrades need to be performed on a particular raw QL\ndataset to bring it up to the state of the configured QL libraries. This\ncomputation is part of what happens during an ordinary database upgrade,\nand is exposed as a separate plumbing command in order to (a) help with\ntroubleshooting, and (b) provide a starting point for modifying the path\nin extraordinary cases where exact control is needed.\n\n## Options\n\n### Primary Options\n\n#### `--dbscheme=<file>`\n\n\\[Mandatory] The _current_ dbscheme of the dataset we want to upgrade.\n\n#### `--format=<fmt>`\n\nSelect output format. Choices include:\n\n`lines` _(default)_: Print upgrade scripts on one line each.\n\n`json`: Print a JSON array of upgrade script paths.\n\n#### `--just-check`\n\nDon't print any output, but exit with code 0 if there are upgrades to\ndo, and code 1 if there are none.\n\n### Options from the invoking command's command line\n\n#### `--search-path=<dir>[:<dir>...]`\n\nA list of directories under which QL packs containing upgrade recipes\nmay be found. Each directory can either be a QL pack (or bundle of packs\ncontaining a `.codeqlmanifest.json` file at the root) or the immediate\nparent of one or more such directories.\n\nIf the path contains directories trees, their order defines precedence\nbetween them: if a pack name that must be resolved is matched in more\nthan one of the directory trees, the one given first wins.\n\nPointing this at a checkout of the open-source CodeQL repository ought\nto work when querying one of the languages that live there.\n\n(Note: On Windows the path separator is `;`).\n\n#### `--additional-packs=<dir>[:<dir>...]`\n\n\\[Advanced] If this list of directories is given, they will be searched\nfor upgrades before the ones in `--search-path`. The order between these\ndoesn't matter; it is an error if a pack name is found in two different\nplaces through this list.\n\nThis is useful if you're temporarily developing a new version of a pack\nthat also appears in the default path. On the other hand it is _not\nrecommended_ to override this option in a config file; some internal\nactions will add this option on the fly, overriding any configured\nvalue.\n\n(Note: On Windows the path separator is `;`).\n\n#### `--target-dbscheme=<file>`\n\nThe _target_ dbscheme we want to upgrade to. If this is not given, a\nmaximal upgrade path will be constructed\n\n#### `--target-sha=<sha>`\n\n\\[Advanced] An alternative to `--target-dbscheme` that gives the\ninternal hash of the target dbscheme instead of the dbscheme file.\n\n#### `--[no-]allow-downgrades`\n\nInclude any relevant downgrades if there are no upgrades\n\n### Common options\n\n#### `-h, --help`\n\nShow this help text.\n\n#### `-J=<opt>`\n\n\\[Advanced] Give option to the JVM running the command.\n\n(Beware that options containing spaces will not be handled correctly.)\n\n#### `-v, --verbose`\n\nIncrementally increase the number of progress messages printed.\n\n#### `-q, --quiet`\n\nIncrementally decrease the number of progress messages printed.\n\n#### `--verbosity=<level>`\n\n\\[Advanced] Explicitly set the verbosity level to one of errors,\nwarnings, progress, progress+, progress++, progress+++. Overrides `-v`\nand `-q`.\n\n#### `--logdir=<dir>`\n\n\\[Advanced] Write detailed logs to one or more files in the given\ndirectory, with generated names that include timestamps and the name of\nthe running subcommand.\n\n(To write a log file with a name you have full control over, instead\ngive `--log-to-stderr` and redirect stderr as desired.)\n\n#### `--common-caches=<dir>`\n\n\\[Advanced] Controls the location of cached data on disk that will\npersist between several runs of the CLI, such as downloaded QL packs and\ncompiled query plans. If not set explicitly, this defaults to a\ndirectory named `.codeql` in the user's home directory; it will be\ncreated if it doesn't already exist.\n\nAvailable since `v2.15.2`."}