Skip to main content
Database
Data recovery
Restore your development database to a checkpoint or roll your production database back to a point in time.
Mistakes happen: a bad schema change, deleted rows, or an Agent session that went sideways. Replit gives you a recovery path for each database.


How far back you can restore depends on your plan and your retention setting. Core retains up to 7 days of history, while Pro and Enterprise retain up to 28 days. Every plan starts at 7 days, and you can change the window in your production database’s settings. Longer windows use more storage, so extending retention increases your usage costs. If you downgrade from Pro to Core, your retention window is reduced to 7 days.
The $0.35 logical storage charge applies whether you use PITR, scheduled backups, or both. Scheduled backup storage costs less per GiB than PITR storage. If daily restore points meet your needs, scheduled backups with a shorter PITR window can reduce recovery storage costs. Your total backup cost depends on the stored backup volume and retention period.
PITR provides more restore points within its window. Scheduled backups provide one restore point per day, so select the recovery method that matches your needs.
Restore your development database
You can revert your app and development database to a previous state using the rollback feature. This restores your database to any checkpoint created by Agent.
Make sure to select “Database” under “Additional rollback options” when
restoring to the state of a checkpoint. This restores your database to the
state it was at the time of the checkpoint.
Restore your production database
For production databases, you can restore to a specific moment using point-in-time restore.
Schedule production database backups
Scheduled backups create one full restore point each day. Replit schedules the backup near midnight in your browser’s current time zone when you enable or update the schedule.- Open the Database tool and select the production database.
- Open Settings, then expand Scheduled backups under Advanced.
- To enable scheduled backups, select a retention period under Keep backups for.
Storage costs
Replit meters each production database storage category separately:Database storage costs are currently discounted by 100%.
The schedule uses your current UTC offset. A daylight-saving change can move
the backup time by one hour until you update the schedule. Time zones with
fractional offsets use the nearest hour.
Restore a scheduled backup
- Open Scheduled backups in the production database settings.
- Select View all backups.
- Select Restore for the restore point that you want.
- Enter
restore, then select Continue.
Troubleshooting publishing failures
If publishing fails due to database issues:- Check the publishing logs for specific error messages about database connectivity or schema conflicts
- Review recent schema changes for potential conflicts with existing application code
- Test your changes in a deployment preview before attempting to republish
Next steps
- Development and production: How your two databases work together.
- Checkpoints and rollbacks: Roll your whole app back.
