有没有办法在.Net 中打开 Zope DB?

发布于 2024-08-25 04:36:33 字数 122 浏览 13 评论 0原文

我需要升级基于 Zope 的旧系统,我需要能够将数据导出到 SQL Server 之类的东西...有谁知道我可以在 .NET 中打开 Zope DB 或直接将其导出到 SQL Server 的方法吗?

谢谢, 基隆

I need to upgrade an old system based on Zope, I need to be able to export the data to something like SQL Server...does anyone know of a way I can open the Zope DB in .NET or directly export it to SQL Server?

Thanks,
Kieron

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

遗失的美好 2024-09-01 04:36:33

我是一名 Plone Web 开发人员,Jason Coombs 是正确的。 ZODB 是一个对象数据库,包含 python 对象。这些对象可以是 python 代码、数据、元数据等,并存储在层次结构中。这与 SQL 表和存储过程的世界非常不同。 (日益增长的 NoSQL 运动表明 Zope 并不是唯一这样做的。)此外,由于这些是复杂的 Python 对象,您确实希望使用创建它的 Python 版本来处理 ZODB,或者确保您可以进行适当的迁移。我认为您无法使用 IronPython 来做到这一点。

如果不知道您想从 ZODB 中得到什么,就很难给出具体的建议。正如 Jason 所建议的,尝试通过 WebDAV/FTP 访问 ZODB 可能就是您所需要的。这允许提取页面或图像文件的基本内容,但您可能会丢失许多更复杂的数据(例如,事件页面可能不包含其所有日期时间数据),并且您将丢失许多元数据-数据。

以下是某人从 Plone 迁移到 Word press 的方式:

http:// www.len.ro/2008/10/plone-to-wordpress-migration/

有很多关于从一个 Plone 版本迁移到另一个版本的文章。其中一些信息可能对您有用。 stackoverflow 不允许我发布更多链接,但搜索:

“当 plone 迁移失败时,仅进行内容迁移”

“Plone 产品内容迁移”

I am a Plone web developer, and Jason Coombs is correct. The ZODB is an Object Data Base, and contains python objects. These objects can be python code, data, meta-data, etc and are stored in a hierarchy. This is very different from the world of SQL tables and stored procedures. (The growing NoSQL movement, shows that Zope is not the only one doing this.) Additionally, since these are complex python objects you really want to be working on the ZODB with the version of python it was created with, or make sure that you can do a proper migration. I don't think that you will be able to do this with IronPython.

Without knowing what you are trying to get out of the ZODB, it is hard to give specific advice. As Jason suggested, trying WebDAV/FTP access to the ZODB might be all that you need. This allows to pull out the basic content of pages, or image files, but you may loose much of the more complex data (for example an event page may not have all of its datetime data included) and you will loose much of of the meta-data.

Here is how someone migrated from Plone to Word press:

http://www.len.ro/2008/10/plone-to-wordpress-migration/

There are a number of articles on migrating from one Plone version to another. Some of this information maybe useful to you. stackoverflow is not allowing me to post more links but search for:

"when the plone migration fails doing content migration only"

"Plone Product ContentMigration"

深海夜未眠 2024-09-01 04:36:33

首先要注意的是,Zope 对象数据库 (ZODB) 在其层次结构中存储 Python 对象。因此,从 ZODB 中获取“数据”在 Python 语言之外通常没有意义。因此在某种程度上,这实际上取决于您想要获取的数据类型。

如果您要查找的数据是文件(例如 HTML、文档等),您也许可以建立 Zope 服务器并打开 WebDAV 或 FTP 之类的东西并以这种方式提取文件。

然而,根据您描述的方式,我怀疑您寻求的数据是更细粒度的数据元素(例如数字或帐户或类似的东西)。在这种情况下,您几乎肯定需要某种 Python 来提取数据并将其转换为适合导入 SQL Server 的某种格式。您也许可以通过使用 IronPython 留在 .NET 世界中,但说实话,我会避免这样做,除非您能找到 IronPython 与 ZODB 库配合使用的证据。

相反,我建议复制 Zope 安装和 Zope 实例(这样就不会破坏正在运行的系统),然后使用 Zope 使用的 Python 版本(通常安装在一起)来挂载数据库,并将其操作为合适的格式。您甚至可以使用 PyODBC 之类的工具连接到 SQL Server 数据库以注入数据,或者您可以将数据导出为某种文件格式,然后使用您更熟悉的工具来导入数据。

我已经有一段时间没有与 ZODB 互动了,但我记得这篇文章在帮助我与 ZODB 交互并理解其结构方面发挥了重要作用。

祝你好运!

The first important thing to note is that the Zope Object Database (ZODB) stores Python objects in its hierarchy. Therefore, getting "data" out of the ZODB generally does not make sense outside of the Python language. So to some extent, it really depends on the type of data you want to get out.

If the data you're seeking is files (such as HTML, documents, etc), you might be able to stand up a Zope server and turn on something like WebDAV or FTP and extract the files that way.

The way you've described it, however, I suspect the data you seek is more fine-grained data elements (like numbers or accounts or some such thing). In that case, you'll almost certainly need Python of some kind to extract the data and transform it into some format suitable to import into SQL Server. You might be able to stay inside the .NET world by using IronPython, but to be honest, I would avoid that unless you can find evidence that IronPython works with the ZODB library.

Instead, I suggest making a copy of your Zope installation and zope instance (so you don't break the running system), and then use the version of Python used by Zope (often installed together) to mount the database, and manipulate it into a suitable format. You might even use something like PyODBC to connect to the SQL Server database to inject the data -- or you may punt, export to some file format, and use tools you're more familiar with to import the data.

It's been a while since I've interacted with a ZODB, but I remember this article was instrumental in helping me interact with the ZODB and understand its structure.

Good luck!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文