Deleting a Database
This guide explains how to delete a database and what happens to linked apps.
How to Delete
- Navigate to Databases in the sidebar
- Click on your database name
- Scroll to the Delete Database section
- Click Delete Database
- Type your database name to confirm
- Click Delete to proceed
Confirmation Required
To prevent accidental deletion, you must type the exact database name before the delete button becomes active.
What Happens When You Delete
Linked Apps
All apps linked to the database are automatically unlinked:
- The
DATABASE_URL(or custom variable name) is removed from each app's environment - Apps are not automatically redeployed
- You may need to update your app configuration to handle the missing database connection
Data Retention
When a database is deleted:
- The database name becomes available for reuse
- Compute resources (CPU, memory) are immediately released
- Storage data is preserved in a separate namespace for a limited time
Important: Do not rely on data retention for backup purposes. Always maintain your own backups of critical data.
Billing
- Billing stops immediately upon deletion
- You are not charged for the deleted database after the deletion time
- Any usage up to the deletion point is included in your current billing cycle
Before Deleting
Consider these steps before deleting a database:
- Export your data - Create a backup of any data you want to keep
- Update linked apps - Prepare your apps to handle the missing database
- Check for dependencies - Ensure no critical services rely on this database
- Verify the database name - Make sure you're deleting the correct database
Recovering a Deleted Database
Deleted databases cannot be directly recovered. If you need to restore:
- Create a new database with the same configuration
- Restore your data from a backup
- Update your apps with the new connection string
Troubleshooting
Delete Button Disabled
- Ensure you've typed the database name exactly as shown
- Check for any extra spaces before or after the name
- Names are case-sensitive
Apps Still Trying to Connect
After deletion, apps may show errors trying to connect to the old database:
- Update or remove the database environment variable
- Redeploy the app with updated configuration
- Check application logs for connection errors