Prerequisites
- A Cloud Storage bucket with uniform bucket-level access enabled. New buckets have it enabled by default.
- Permission to change the bucket’s IAM policy, and the
gcloudCLI. - The project number of the project that owns the bucket.
- The workspace admin or owner role in Lovable, on an Enterprise plan.
Set up the export
Create the export in Lovable, then run the two grant commands from the setup panel.1
Start a new export
Go to Data exports, click New data export, and choose Google Cloud Storage under Destination.
2
Enter the bucket details
Fill in the form:
- Bucket: the bucket name, for example
acme-lovable-exports. - Project number: the number of the project that owns the bucket, for example
123456789012. Find it withgcloud projects describe PROJECT_ID --format='value(projectNumber)'or on the project dashboard in the console. Enter the number, not the project ID. - Prefix (optional): a folder for the files. Leave it blank to use
lovable-export/.
3
Run both grant commands
Copy the Grant commands from the setup panel and run them:
- The first command grants
roles/storage.objectUser, which lets Lovable create and delete export files. Its condition blocks writes anywhere outside your Lovable workspace’s path in the bucket. - The second command lets Lovable read the bucket’s metadata. Lovable uses it to check that the bucket still belongs to your project before every export.
4
Choose the source and test
Choose the Source and click Test connection. Lovable checks that the bucket belongs to your project, writes and deletes a small test object under your workspace’s path in the bucket, and checks that the grant is limited to your workspace’s path.
5
Create the export
Click Create export. Lovable runs the project and grant checks again when you save.
Exported files
Each run writes one file per window under your prefix. See Object storage file layout for the full path. For example:Bucket ownership check
Before every export, Lovable checks that the bucket still belongs to the project number on the export. Bucket names can be reused after a bucket is deleted, so this check stops Lovable from writing to a bucket that someone else now owns. If the bucket no longer exists or belongs to another project, Lovable pauses the export and the run fails. Fix the bucket, then resume the export with the Schedule switch.Query with BigQuery
You can read the files with a BigQuery external table. Point it at thesource= folder of your export:
timestamp arrives as text such as 2026-10-13 09:41:07.123456 in UTC. Remove duplicates by keeping one row per id.
Troubleshooting
Bucket grant is too broad
Bucket grant is too broad
The bucket accepts Lovable writes outside your workspace’s path. Run the first grant command again with its
--condition intact. IAM conditions need uniform bucket-level access on the bucket. If several workspaces export to this bucket, add one conditioned grant per workspace. If you just tightened the grant, wait a minute and test again.Bucket is not in the configured project
Bucket is not in the configured project
The bucket belongs to a different project than the project number on the export. Check the project number with
gcloud projects describe PROJECT_ID --format='value(projectNumber)'. Check that nobody deleted the bucket and created it again in another project.Cannot verify the bucket's project
Cannot verify the bucket's project
Lovable cannot read the bucket’s metadata. Run the second grant command from the setup panel (
roles/storage.bucketViewer on the bucket), then test again.Bucket not found
Bucket not found
Check the bucket name. The bucket must exist.
Write to bucket denied
Write to bucket denied
The grant does not allow writes under your prefix (
storage.objects.create). Run the first grant command from the setup panel. If you changed the prefix, run the updated command.Connected, but cleanup is blocked
Connected, but cleanup is blocked
Lovable can write but not delete (
storage.objects.delete). The test object stays in the bucket, and Lovable cannot clean up after a failed run. Add delete permission under the prefix.