Question

how to recover data in app platforme "sqllite"

i have django app in app platforme and sqlite as db the server restarted i dont know why and after that the data is gone and db is on initial state there is method i can recover data ? thank you


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
December 3, 2023

Hi there,

With the DigitalOcean App Platform, similar to a standard Kubernetes cluster, the local storage is ephemeral.

This means that any data stored locally on the platform’s local storage, including data in an SQLite database, can be lost whenever the container is restarted or the app is redeployed. This is likely what happened in your case, leading to the loss of your data and the database reverting to its initial state.

For more information you a take a look at the documentation here:

https://docs.digitalocean.com/products/app-platform/how-to/store-data/

Unfortunately, once the data is lost in such scenarios, recovery is typically not possible. The ephemeral nature of the storage does not maintain a persistent state across restarts or redeployments.

To avoid such issues in the future, it’s advisable not to use local storage solutions like SQLite for applications deployed on these platforms. Instead, consider using a managed database service. Managed databases are designed for cloud environments and offer several advantages:

  1. Persistence: They are not subject to the ephemeral nature of the App Platform, ensuring that your data remains intact across restarts and redeployments.

  2. Scalability: Managed databases can be scaled easily to handle increased load, which is beneficial for growing applications.

  3. Backup and Recovery: They include automatic backup and recovery solutions, which can be crucial for data integrity and disaster recovery.

  4. Performance and Reliability: Managed databases are optimized for performance and reliability, offering better uptime and speed compared to local database solutions in a cloud environment.

By migrating to a managed database service, you can ensure that your application’s data remains secure and persistent, avoiding the issues you’ve encountered with SQLite on the App Platform.

Hope that this helps!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.