Skip to content

Commit 94e1618

Browse files
committed
fix: Correct Redis backup/restore commands
1 parent 781739a commit 94e1618

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

content/posts/replacing-heroku-with-self-hosting.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ excerpt: 'How we migrated from expensive Heroku dynos to a self-managed DigitalO
44
category:
55
name: 'Cloud'
66
slug: 'cloud'
7+
coverImage: '/images/posts/replacing-heroku-with-self-hosting.png'
8+
ogImage: '/images/posts/replacing-heroku-with-self-hosting.png'
79
date: '2026-03-03'
810
publishedAt: '2026-03-03T10:00:00Z'
911
updatedAt: '2026-03-03T10:00:00Z'
@@ -46,7 +48,7 @@ Add-ons:
4648
- Heroku Redis Premium-0 ($60) = $60
4749
- Heroku Data for Redis ($15) = $15
4850
- SSL Certificates (SNI included) = $0
49-
- Papertrail Fixa ($7) = $7
51+
- Papertrail ($7) = $7
5052
5153
Data Transfer:
5254
- Outbound data (~500GB/mo) = ~$200
@@ -225,9 +227,18 @@ pg_restore --verbose --clean --no-acl --no-owner \\
225227
For Redis, we chose to start fresh since it was just cache. If you need to migrate:
226228

227229
```bash
228-
# Using redis-cli to export/import
229-
redis-cli --rdb heroku-redis.rdb
230-
redis-cli --pipe < heroku-redis.rdb
230+
# Save RDB snapshot from Heroku Redis
231+
redis-cli -h <heroku-redis-host> -p <port> -a <password> --rdb heroku-redis.rdb
232+
233+
# On your new server, stop Redis temporarily
234+
sudo systemctl stop redis
235+
236+
# Replace dump.rdb with your backup
237+
sudo cp heroku-redis.rdb /var/lib/redis/dump.rdb
238+
sudo chown redis:redis /var/lib/redis/dump.rdb
239+
240+
# Restart Redis to load the data
241+
sudo systemctl start redis
231242
```
232243

233244
### Phase 3: Application Migration (Day 2-3)
22.9 KB
Loading

0 commit comments

Comments
 (0)