Stay organized with collections
Save and categorize content based on your preferences.
The EXPORT MODEL statement
To export an existing model from BigQuery ML to
Cloud Storage, use the EXPORT MODEL
statement.
For more information about supported model types, formats, and limitations, see
Export models.
For information about supported model types of each SQL statement and function,
and all supported SQL statements and functions for each model type, read
End-to-end user journey for each model.
Syntax
The following is the syntax of EXPORT MODEL for a regular model that is not generated from BigQuery ML hyperparameter tuning.
EXPORTMODELMODEL_NAME[OPTIONS(URI=STRING_VALUE)]
MODEL_NAME is 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_VALUE is the URI of a Cloud Storage bucket where the model
is exported. This option is required for the EXPORT MODEL statement. For
example:
URI='gs://bucket/path/to/saved_model/'
For a model that is generated from BigQuery ML hyperparameter tuning,
EXPORT MODEL can 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-08-07 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,[]]