简体   繁体   English

有什么方法可以将新的Wordpress网站与RoR Web应用程序连接起来,并可以在不进行数据迁移的情况下从Wordpress网站管理其旧数据库?

[英]Is there any way to connect a new Wordpress site with a RoR web app and to manage its legacy database from the Wordpress site without data migration?

I currently have a Ruby on Rails web application and an existing database made by previous team project. 我目前有一个Ruby on Rails Web应用程序和一个先前的团队项目创建的现有数据库。

What I need to do is to migrate that website to Wordpress. 我需要做的是将该网站迁移到Wordpress。 I've developed something in Wordpress with the help of Custom Content Type plugin and it creates some custom posts correctly. 我借助自定义内容类型插件在Wordpress中开发了一些东西,它可以正确创建一些自定义帖子。

Now, the problem is how to migrate the database with all data to the other one with Wordpress structure. 现在,问题是如何将包含所有数据的数据库迁移到具有Wordpress结构的另一个数据库。

Someone told me about the WP Rest API plugin for Wordpress, but I think that it won't work for me because it allows you to connect several websites only when all of them are Wordpress sites, or when one of them is a non Wordpress site, but in this last case you can manage this site from Wordpress and you could perform CRUD actions only in Wordpress site database but not in the other one, I think... or am I wrong? 有人告诉我有关Wordpress的WP Rest API插件的信息,但我认为它对我不起作用,因为只有当所有这些网站都是Wordpress网站或其中一个是非Wordpress网站时,它才允许您连接多个网站。 ,但是在最后一种情况下,您可以通过Wordpress管理此站点,并且只能在Wordpress站点数据库中执行CRUD操作,而不能在另一个数据库中执行CRUD操作,我想...还是我错了?

Basically, I need to manage current database from the Wordpress site and to show all the information to the user. 基本上,我需要从Wordpress网站管理当前数据库,并将所有信息显示给用户。

Anyone can help me, please? 有人可以帮助我吗? Any idea would be very appreciated! 任何想法将不胜感激! Thanks in advance. 提前致谢。

This sounds very ambitious! 听起来很雄心勃勃! Here's what I would do: 这就是我要做的:

Create a rake task in the current ruby site that loops through every existing blog and create a new blog on the wordpress site through the Wordpress API. 在当前的ruby网站中创建一个rake任务,该任务循环遍历每个现有博客,并通过Wordpress API在wordpress网站上创建一个新博客。

It looks like there is a gem that could make this very easy. 看起来好像有一颗宝石可以使这一过程变得非常容易。 https://github.com/zachfeldman/rubypress https://github.com/zachfeldman/rubypress

# Here is some pseudo code
# Make new api client
wordpress_api = Client.new 

ExistingPost.find_each do |blog_post|
  wordpress_api.post(blog_post details here)
end

I would avoid the database to database migration if I could because it would be more tedious. 如果可以的话,我将避免从数据库迁移到数据库,因为这样会更加乏味。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM