The following is the syntax ofEXPORT MODELfor a regular model that is not generated from BigQuery ML hyperparameter tuning.
EXPORTMODELMODEL_NAME[OPTIONS(URI=STRING_VALUE)]
MODEL_NAMEis the name of the BigQuery ML
model you're exporting. If you are exporting a model in another project,
you must specify the project, dataset, and model in the following format,
including backticks:
`PROJECT.DATASET.MODEL`
For example,`myproject.mydataset.mymodel`.
If the model name does not exist in the dataset, the following error is
returned:
Error: Not found: Model myproject:mydataset.mymodel
STRING_VALUEis theURI of a Cloud Storagebucket where the model
is exported. This option is required for theEXPORT MODELstatement. For
example:
URI='gs://bucket/path/to/saved_model/'
For a model that is generated from BigQuery ML hyperparameter tuning,EXPORT MODELcan also export an individual trial to a destination URI. For example:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eEXPORT MODEL\u003c/code\u003e statement is used to transfer a BigQuery ML model to a Cloud Storage location.\u003c/p\u003e\n"],["\u003cp\u003eThe syntax for \u003ccode\u003eEXPORT MODEL\u003c/code\u003e includes specifying the model's name and the Cloud Storage URI destination within the \u003ccode\u003eOPTIONS\u003c/code\u003e clause.\u003c/p\u003e\n"],["\u003cp\u003eWhen exporting a model from another project, the model name must be formatted with the project, dataset, and model, separated by periods, and enclosed in backticks.\u003c/p\u003e\n"],["\u003cp\u003eFor models created using hyperparameter tuning, you can export a specific trial by including its numeric ID in the \u003ccode\u003eTRIAL_ID\u003c/code\u003e option.\u003c/p\u003e\n"],["\u003cp\u003eIf no \u003ccode\u003eTRIAL_ID\u003c/code\u003e is provided when exporting a hyperparameter-tuned model, the best-performing trial is automatically exported.\u003c/p\u003e\n"]]],[],null,["# The EXPORT MODEL statement\n==========================\n\nTo export an existing model from BigQuery ML to\n[Cloud Storage](/storage/docs), use the `EXPORT MODEL`\nstatement.\n\nFor more information about supported model types, formats, and limitations, see\n[Export models](/bigquery/docs/exporting-models).\n\nFor information about supported model types of each SQL statement and function,\nand all supported SQL statements and functions for each model type, read\n[End-to-end user journey for each model](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-e2e-journey).\n\nSyntax\n------\n\nThe following is the syntax of `EXPORT MODEL` for a regular model that is not generated from BigQuery ML hyperparameter tuning. \n\n EXPORT MODEL \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eMODEL_NAME\u003c/span\u003e\u003c/var\u003e [OPTIONS(URI = \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eSTRING_VALUE\u003c/span\u003e\u003c/var\u003e)]\n\n- \u003cvar translate=\"no\"\u003eMODEL_NAME\u003c/var\u003e is the name of the BigQuery ML\n model you're exporting. If you are exporting a model in another project,\n you must specify the project, dataset, and model in the following format,\n including backticks:\n\n `\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePROJECT\u003c/span\u003e\u003c/var\u003e.\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eDATASET\u003c/span\u003e\u003c/var\u003e.\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eMODEL\u003c/span\u003e\u003c/var\u003e`\n\n For example, ```myproject.mydataset.mymodel```.\n\n If the model name does not exist in the dataset, the following error is\n returned:\n\n `Error: Not found: Model myproject:mydataset.mymodel`\n- \u003cvar translate=\"no\"\u003eSTRING_VALUE\u003c/var\u003e is the [URI of a Cloud Storage](/bigquery/docs/loading-data-cloud-storage#gcs-uri) bucket where the model\n is exported. This option is required for the `EXPORT MODEL` statement. For\n example:\n\n URI = 'gs://bucket/path/to/saved_model/'\n\nFor a model that is generated from BigQuery ML hyperparameter tuning,\n`EXPORT MODEL` can also export an individual trial to a destination URI. For example: \n\n EXPORT MODEL \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eMODEL_NAME\u003c/span\u003e\u003c/var\u003e [OPTIONS(URI = \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eSTRING_VALUE\u003c/span\u003e\u003c/var\u003e [, TRIAL_ID = \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eINT_VALUE\u003c/span\u003e\u003c/var\u003e])]\n\n- \u003cvar translate=\"no\"\u003eINT_VALUE\u003c/var\u003e is the numeric ID of the exporting trial.\n For example:\n\n ```sql\n TRIAL_ID = 12\n ```\n\n- If `TRIAL_ID` is not specified, then the optimal trial is exported by default."]]