SQLlite data loss after deployment
muhammadyahyo566
FREEOP

2 months ago

Hello,

I recently deployed my application on Railway using a SQLite database file (users.db). After a redeploy/restart, my database was unexpectedly reset and all data was lost.

This project is already in active use, and the data is very important for me.

I would like to ask:

Is there any possibility to restore or recover the previous version of my SQLite database from your system (backups, snapshots, or container history)?

If any recovery is possible, I would greatly appreciate your assistance.

Thank you.

Solved

3 Replies

Railway
BOT

2 months ago

Your "telegram-bot" service in the "imaginative-courtesy" project has been removed and had no volume attached, which means the SQLite file (users.db) was stored on the ephemeral filesystem. Railway's deploy filesystem is wiped on every redeploy, so without a volume, there is no data to recover and we have no backups or snapshots of ephemeral storage. For your other active services, we strongly recommend attaching a volume to persist any file-based data like SQLite databases.


Status changed to Awaiting User Response Railway about 2 months ago


Railway

Your "telegram-bot" service in the "imaginative-courtesy" project has been removed and had no [volume](https://docs.railway.com/volumes) attached, which means the SQLite file (users.db) was stored on the ephemeral filesystem. Railway's deploy filesystem is wiped on every redeploy, so without a volume, there is no data to recover and we have no backups or snapshots of ephemeral storage. For your other active services, we strongly recommend attaching a volume to persist any file-based data like SQLite databases.

muhammadyahyo566
FREEOP

2 months ago

how to get db in your system. i usually use vscodium and when i push my code to github, database is replace in my computer database. can you give me a solution


Status changed to Awaiting Railway Response Railway about 2 months ago


Railway
BOT

2 months ago

Your previous data cannot be recovered since the "telegram-bot" service was removed and had no volume. To prevent this in future deployments, add users.db to your .gitignore file so it is not uploaded when you push to GitHub (Railway respects .gitignore during deploys), then attach a volume to your service and configure your app to write the database into a subdirectory like ./data, with the volume mount path set to /app/data so the file persists across redeploys.


Status changed to Awaiting User Response Railway about 2 months ago


Status changed to Solved muhammadyahyo566 about 2 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...