Best practices for core data store (sqlite) backup?

橙三吉。 提交于 2019-12-03 04:01:53

If you just want to do a backup, copy the sqlite file to another location. If you are looking for something more complicated, please update your question with the specific requirements.

Update

What other sort of more complicated options are available? I haven't see anyone do much besides actually copying the sqlite file.

Everything. You can integrate with the DropBox API and copy the file there. You can push changes to a REST service on a server, you can build a connection to MobileMe and push a copy there, you can translate it to JSON and push it anywhere. You can fax it to someone.

You could even set up a multi-file backup strategy that goes back six months: hourly for 24 hours, daily for 7 days, weekly for 4 weeks and monthly forever.

How you back up is an implementation detail. Core Data is open enough that you can translate it into any format you want and push it anywhere you want. It all depends on how much effort you want to put into it and where do you want to go with it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!