Automated Backups Stay organized with collections Save and categorize content based on your preferences.
Blaze plan users can set up theirFirebase Realtime Database forautomatic backups, a self-service feature that enables daily backups of yourDatabase application data andrules in JSON format to aCloud Storage bucket.
Setup
To get started, visit theBackupstab inthe Database section of theFirebase console, and the wizard will guide youthrough setting up your automated backups.
To save on storage costs, we enableGzipcompression by default, and you can choose to enable a30-day lifecycle policyon your bucket to have backups older than 30 days automatically deleted.
You can view the status and backup activity directly in theFirebase consolewhere you can also start a manual backup. This can be useful for taking specifictimed snapshots or as a safety action before you perform any code changes.
Once set up, a newCloud Storage bucket will be created for you with theWRITER permission for Firebase. You should not store data in this bucket you are not comfortablewith Firebase having access to. Firebase will have no additional access to yourotherCloud Storage buckets or any other areas ofGoogle Cloud.
Restoring from backups
To restore your Firebase from a backup, first download the file fromCloud Storage to your local disk. This can be done by clicking the filenamewithin the backup activity section or from theCloud Storage bucketinterface. If the file is Gzip compressed, firstdecompress the file.
There are two ways you can import your data:
Method 1: Click the Import JSON button in yourDatabase’s Data section and select your application data JSON file.
Method 2: You can also issue a CURL request from your command line.
First retrieve a secret from your Firebase, which you can get by visitingtheDatabase settings page.
Then enter the following into your terminal, replacing theDATABASE_NAMEandSECRET fields with your own values:
curl'https://<DATABASE_NAME>.firebaseio.com/.json?auth=<SECRET>&print=silent'-XPUT-d@<DATABASE_NAME>.jsonIf you are having trouble restoring a backup from a very large database, pleasereach out to oursupport team.
Scheduling
Your Database backup is assigned to a specific hour each day that ensures evenload and highest availability for all backup customers. This scheduled backupwill occur regardless of if you do any manual backups throughout the day.
File naming
Files transferred to yourCloud Storage bucket will be timestamped(ISO 8601 standard) and use the following naming conventions:
- Database data:
YYYY-MM-DDTHH:MM:SSZ_<DATABASE_NAME>_data.json - Database rules:
YYYY-MM-DDTHH:MM:SSZ_<DATABASE_NAME>_rules.json
IfGzipis enabled, a.gz suffix will be appended to the filenames. You caneasily find the backups from a specific date or time usingCloud Storageprefix searching.
Gzip compression
By default, we compress your backup files using Gzip compression to save onstorage costs and decrease transfer times. The compressed filesize variesdepending on the data characteristics of your Database, but typical Databasesmay shrink to ⅓ their original size, saving you on storage costs and decreasingthe upload time for your backups.
To decompress your Gzipped JSON files, issue a command line command using thegunzip binary which is shipped by default for OS-X and most Linuxdistributions.
gunzip <DATABASE_NAME>.json.gz # Will unzip to <DATABASE_NAME>.jsonStorage 30 day lifecycle
We offer an easy to use configuration switch that enables a default 30 dayobject lifecycle policy for yourCloud Storage bucket. When enabled, files inyour bucket will be automatically deleted after 30 days. This helps to reduceunwanted old backups, saving you on storage costs, and keeping your bucketdirectory clean. If you place other files into your Automated Backups bucket,they will also be deleted with the same policy.
Costs
The backups feature can be enabled for projects on theBlaze planfor no additional cost. However, you will be charged at thestandardrates for the backup filesplaced in yourCloud Storage bucket. You can enableGzipCompression andStorage 30 dayLifecycle to reduce your storagecosts.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-18 UTC.