核心数据存储(sqlite)备份的最佳做法? [英] Best practices for core data store (sqlite) backup?

查看:154
本文介绍了核心数据存储(sqlite)备份的最佳做法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的新iphone应用程序进行更新,该更新将包括备份和备份功能.恢复核心数据存储(SQLite).我一直在寻找执行此操作的好方法,但是关于此的资源很少.您发现进行核心数据备份的最佳实践是什么?我想使配置尽可能简单,以便用户实际备份.众所周知,用户很少手动备份.我希望它可以自动化.

I am working on an update for my new iphone app which will include the ability to back up & restore the Core Data store (SQLite). I have been looking for good options for how to do this but there are very few resources about this. What are the best practices that you have found for doing Core Data backup? I'd like to keep the configuration as simple as possible so that users actually back up. As we know, users very rarely back up manually. I'd like it to be automated if possible.

您发现什么是核心数据存储(SQLite)备份的最佳实践?

What have you found to be best practices for Core Data store (SQLite) backup?

推荐答案

如果只想进行备份,请将sqlite文件复制到另一个位置.如果您正在寻找更复杂的东西,请根据具体要求更新您的问题.

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.

还有哪些其他更复杂的选项可用?除了实际复制sqlite文件外,我没有看到其他任何事情.

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

一切.您可以与DropBox API集成并在此处复制文件.您可以将更改推送到服务器上的REST服务,可以建立与MobileMe的连接并在其中推送副本,可以将其转换为JSON并将其推送到任何地方.您可以将其传真给某人.

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.

您甚至可以设置一个多文件备份策略,该策略可以追溯到六个月:每小时24小时,每天7天,每周4周和永远每月.

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.

这篇关于核心数据存储(sqlite)备份的最佳做法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆