I want to rename database files. The tasks seems to be easy.
1) I close database 2) rename .db file 3) rename .db-journal file 4) I open database
However what will happen if ex. after the step number 2 and before the step number 3 the system will crash (I know the probabiliby is low, but...)?
I noticed that depending on the Android version sometimes after closing the database .db-journal file has 0 size (ex. android 4.0.4) but sometimes it's quite huge (ex. 50% of .db file size) (ex. android 4.2.2). If size is 0, sure I expect there is no problem (loosing .db-file in the mentionned scenario will probably not cause any missing data). But when the .db-jurnal file is quite huge, does it mean that opening .db file without .db-journal (it will have the old name) will cause any data loss?
Is there any way to rename two files in one "transaction" (either both are renamed either none of them)?
And what if I want to share my database (ex. I want to send it to my friend by e-mail)? Is that a must to send two files .db and .db-journal or only sending .db file is enough?