Back-up data Sql

Ivan Teles - iDev Web 1 Reputation point
2021-06-04T12:54:48.597+00:00

Good morning people. I have an app using sql lite database. I need to do a backup.
Then I made a simple copy of the file. but there is a problem. When copying we verify that the copy does not contain all the data.
Example. I opened the app and registered a new patient right away, then I did the back-up, when I open the base, this guy I just added is not in the back-up. it's as if the data saved inside the app were in the mobile's cache and not in the base. does anyone have any idea how to solve?

Developer technologies .NET Xamarin
SQL Server Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JessieZhang-MSFT 7,716 Reputation points Microsoft External Staff
    2021-06-07T06:33:44.527+00:00

    Hello,

    Welcome to our Microsoft Q&A platform!

    In general, moving, renaming, or copying a database file is the same process as any other file type with a few additional considerations:

    • All database connections should be closed before attempting to move the database file.
    • If you use Write-Ahead Logging, SQLite will create a Shared Memory Access (.shm) file and a (Write Ahead Log) (.wal) file. Ensure that you apply any changes to these files as well.

    So, you can first recheck if you have followed the considerations above .

    For more details, check document :https://learn.microsoft.com/en-us/xamarin/xamarin-forms/data-cloud/data/databases#copy-a-database

    Best Regards,

    Jessie Zhang

    ---
    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.