Render Free Postgres Expired? How to Back Up and Move Your Database
Render's free Postgres expires 30 days after creation, then gets deleted. How to dump it with pg_dump, restore it elsewhere, and avoid it happening again.
- Published
- Reading time
- 5 min
On this page
Key takeaways
- Render's free PostgreSQL databases expire 30 days after creation; you then have 14 days to upgrade before the database is deleted.
- Back up first with pg_dump using the database's external URL, then restore with pg_restore into any PostgreSQL host.
- To stop it happening again, move to a free database that doesn't expire or to a paid plan; don't rely on recreating it every month.
Render's free PostgreSQL databases expire 30 days after they're created. After that, Render gives you a 14-day grace period to upgrade to a paid instance, and then the database is deleted. If you got the expiry email or your app suddenly can't connect, here's how to save your data in about 10 minutes and move it somewhere it won't expire again.
Why your Render database expired
Render's free tier docs say free Postgres instances expire 30 days after creation. Render shortened this from 90 days. The free tier is designed for trying Render, not for keeping data long-term. Free Postgres also has 256 MB of RAM and 1 GB of storage. Paid Render Postgres starts at $6/month.
You have three options:
- Upgrade on Render (from $6/month) and keep everything where it is.
- Recreate a free database every month and re-import your data. This works, but it's fragile, and one missed month loses everything.
- Move to a host whose free database doesn't expire, or to one you'll pay for anyway.
Whichever you pick, the backup steps are the same.
Step 1: Get the external connection string
In the Render dashboard, open your database and copy the External Database URL. It looks like this:
postgresql://USER:PASSWORD@HOST.render.com/DBNAMEKeep it out of your shell history. Put it in a variable for this session only:
export RENDER_DB_URL='postgresql://…' # paste yoursStep 2: Back up with pg_dump
Use a pg_dump whose major version is the same as or newer than the server's version:
pg_dump --format=custom --no-owner --no-acl \
--file=render-backup.dump "$RENDER_DB_URL"--format=custommakes a compressed file thatpg_restorecan restore selectively.--no-owner --no-acldrops Render-specific roles, so the dump restores cleanly on another host.
Check that the backup isn't empty:
pg_restore --list render-backup.dump | headWant a plain SQL file you can read? Use --format=plain --file=render-backup.sql instead.
Step 3: Create the new database
On DockHosting, create a PostgreSQL database in the dashboard (PostgreSQL 16 by default) and attach it to your project. The Free plan's database is 500 MB and never expires. Larger plans give 2 GB (Hobby), 5 GB (Pro) or 20 GB (Team) per database.
Any PostgreSQL host works for the next step. Just use its external connection string.
Step 4: Restore with pg_restore
export NEW_DB_URL='postgresql://…' # the new database's connection string
pg_restore --no-owner --no-acl --dbname="$NEW_DB_URL" render-backup.dumpFor a plain SQL dump, use psql "$NEW_DB_URL" -f render-backup.sql instead.
Then check that your data arrived:
psql "$NEW_DB_URL" -c "select count(*) from users;" # use one of your tablesOn DockHosting you can also run quick checks with dock db sql from the CLI.
Step 5: Point your app at the new database
If your app reads DATABASE_URL, there's nothing to change in the code. On DockHosting, attaching the database injects DATABASE_URL into your app automatically, over a private network. On another host, update the variable and redeploy.
Framework examples are in connecting your app to managed PostgreSQL.
Common restore errors
| Error | Fix |
|---|---|
role "xyz" does not exist | Re-run with --no-owner --no-acl. |
pg_dump: server version mismatch | Install a pg_dump that's the same major version as the server, or newer. |
extension "…" is not available | Create the extension on the new database first, or remove it if unused. |
relation already exists | You're restoring into a non-empty database. Use a fresh one, or add --clean. |
How to avoid this next time
- Use a database that doesn't expire. DockHosting's free database never expires.
- Automate backups. Paid DockHosting plans include daily backups (kept 3, 7 or 30 days). On any host, a weekly
pg_dumpcosts nothing. - Keep your connection string in
DATABASE_URLso moving hosts is a config change, not a code change.
Comparing free tiers before you pick? See free backend hosting in 2026 and the best Heroku alternatives.
Frequently asked questions
How long does Render's free Postgres last?
30 days from creation. After it expires, Render gives you a 14-day grace period to upgrade to a paid instance before the database is deleted. Render shortened this from 90 days.
Can I recover a Render free database after it's deleted?
Plan as if you can't. Take a pg_dump backup before the grace period ends. Once the instance is deleted, don't count on getting the data back.
Is there a free PostgreSQL database that doesn't expire?
Yes. DockHosting's Free plan includes one managed PostgreSQL database with 500 MB that doesn't pause or expire. It's reachable from your apps over a private network through DATABASE_URL.
Do I need to change my app's code to switch databases?
Usually not. If your app reads its connection string from DATABASE_URL, point that variable at the new database and redeploy.
- Render
- PostgreSQL
- Database migration
- pg_dump
- Free hosting
Written by Doughmi ILYAS
Doughmi builds DockHosting, the developer-first platform behind dock deploy: the build system, the managed databases and the dashboard. On this blog: guides to shipping apps without running servers, written with the commands the platform actually ships.
