将重新定义的 SQL 数据从旧应用程序导入到新应用程序
我几乎已经完成了将我的 Symfony(带有一些新功能)应用程序重写到 Rails 中。我需要将一些数据从旧应用程序导入到新的 Rails 应用程序中。
问题是架构发生了巨大变化,并且一些外键值应该更新。
我想知道是否有一些应用程序可以帮助我重新定义和导入数据,或者我应该打开 phpMyAdmin,花一些时间编辑数据库和运行 Rails 上准备的一个? (我认为这不是完成这项工作的最佳方式)
I've nearly finished rewriting (with some new features) my Symfony (left a bit bad taste in mounth) application into Rails. There is some amount of data which I need to import from my old application into the new Rails app.
Problem is that schema was dramatically changed and some foreign key values should be updated.
I am wondering if there is some application which could help me with redefining and importing data, or I just should open phpMyAdmin, spend some time editing database and run Rails on the prepared one? (which in my opinion is not the best way to do the job)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据模式变化的剧烈程度,您可能需要查看像 ActiveWarehouse http://activewarehouse 这样的 ETL 库。 rubyforge.org/etl/。
或者,您可以编写 sql 迁移来升级数据,但我不知道您的情况有多复杂。
另外,如果这是一次性的并且没有那么多数据并且您只有一个环境,那么直接在数据库中执行它也不是那么糟糕,只要您继续确保正确迁移即可。
Depending on how dramatically the schema has changed you might want to look into an ETL library like ActiveWarehouse http://activewarehouse.rubyforge.org/etl/.
Alternatively you could write the sql migration to upgrade the data, but I don't know how complicated that would be in your case.
Also, if this is a one off and there isn't that much data and you only have one environment then doing it directly in the database isn't THAT bad, as long as going forward you make sure your migrating properly.