{"meta":{"title":"database bundle","intro":"Create a relocatable archive of a CodeQL database.","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/database-bundle","title":"database bundle"}],"documentType":"article"},"body":"# database bundle\n\nCreate a relocatable archive of a CodeQL database.\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 database bundle --output=<output> <options>... -- <database>\n```\n\n## Description\n\nCreate a relocatable archive of a CodeQL database.\n\nA command that zips up the useful parts of the database. This will only\ninclude the mandatory components, unless the user specifically requests\nthat results, logs, TRAP, or similar should be included.\n\n## Options\n\n### Primary Options\n\n#### `<database>`\n\n\\[Mandatory] Path to the CodeQL database to bundle.\n\n#### `-o, --output=<output>`\n\n\\[Mandatory] The output file, typically with the extension \".zip\".\n\n#### `--[no-]include-diagnostics`\n\nInclude diagnostics in the bundle.\n\nAvailable since `v2.16.0`.\n\n#### `--[no-]include-results`\n\nInclude any precomputed query results in the bundle.\n\n#### `--[no-]include-logs`\n\nInclude the logs directory in the bundle.\n\nAvailable since `v2.17.6`.\n\n#### `--[no-]include-temp`\n\nIncludes the \"temp\" directory, where any generated packs, queries, and\nsuites are located.\n\nAvailable since `v2.13.3`.\n\n#### `--[no-]include-uncompressed-source`\n\nInclude an uncompressed version of the source archive directory. This is\nnecessary for legacy CodeQL plugins (like CodeQL for Eclipse).\n\n#### `--include=<include>`\n\n\\[Advanced] Additional paths relative to the database directory to\ninclude in the bundle.\n\nAvailable since `v2.24.0`.\n\n#### `--name=<name>`\n\nThe name of the top-level directory in the bundle. If not given, it\ndefaults to the name of the database directory.\n\n### Low-level dataset cleanup options\n\n#### `--max-disk-cache=<MB>`\n\nSet the maximum amount of space that the disk cache for intermediate\nquery results can use.\n\nIf this size is not configured explicitly, the evaluator will try to use\na \"reasonable\" amount of cache space, based on the size of the dataset\nand the complexity of the queries. Explicitly setting a higher limit\nthan this default usage will enable additional caching which can speed\nup later queries.\n\n#### `--min-disk-free=<MB>`\n\n\\[Advanced] Set target amount of free space on file system.\n\nIf `--max-disk-cache` is not given, the evaluator will try hard to\ncurtail disk cache usage if the free space on the file system drops\nbelow this value.\n\n#### `--min-disk-free-pct=<pct>`\n\n\\[Advanced] Set target fraction of free space on file system.\n\nIf `--max-disk-cache` is not given, the evaluator will try hard to\ncurtail disk cache usage if the free space on the file system drops\nbelow this percentage.\n\n#### `--cache-cleanup=<mode>`\n\nSelect how aggressively to trim the cache. Choices include:\n\n`clear`: Remove the entire cache, trimming down to the state of a\nfreshly extracted dataset\n\n`trim` _(default)_: Trim everything except explicitly \"cached\"\npredicates.\n\n`fit`: Simply make sure the defined size limits for the disk cache are\nobserved, deleting as many intermediates as necessary.\n\n`overlay`: Trim to just the data that will be useful when evaluating\nagainst an overlay.\n\n#### `--cleanup-upgrade-backups`\n\nDelete any backup directories resulting from database 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`."}