0

Drupal A and B are different domain (example: drupal A: www.aaa.com and drupal B: www.bbb.com)but at the same server. At Drupal A, there are lot of fields, but I only need to send date field value to Drupal B (Everytime when it update or add new content). Drupal B will get date value and display at the content page. May I know how to do that?

I had tried Deploy (not working at all) How to add data from one Drupal site to other?

I had tried aggregate but I send everything to Drupal B.

I need help. Many thanks.

For far my current solution is: At Drupal B: php code connect drupal A database and get the date vaule. Echo to display at the content page.

4
  • what exactly your problem you are not able send all field data or only want to send date?
    – vgoradiya
    Commented Dec 3, 2015 at 9:26
  • @VimalGoradiya I had edited my question
    – peifa
    Commented Dec 3, 2015 at 9:30
  • How the node form Drupal A and Drupal B are related? When you edit a node in Drupal A another node in Drupal B should get the date field value, and display? What you mean with 'display'?
    – sanzante
    Commented Dec 3, 2015 at 9:33
  • @tunic I had edited my question.
    – peifa
    Commented Dec 3, 2015 at 9:41

3 Answers 3

1

I would solve the problem with either of the following

1) Write a 5 minute custom php script that would show the node ids and data value and then update the nodes with data value in the second database with a simple update query on field_data_field_<your-field-name> table based on entity id.

2) Use services 3 module to expose your data and then import that field with put method with only the field you want.

0

I would suggest that you use drupal_sync module. it allow sync content between multiple websites. Its built on top of API so you can create your own custom module on top of it.

0

You have several options:

  • Use Migrate: This is like what you have but more Drupal way. The migration code should be the iterator that queries your Drupal A and returns the list of nodes and the code that takes each node and updates or creates nodes on Drupal B. I recommend you to put it in a Drush command and call it from system cron (not Drupal cron but system cron).

  • Using some kind of services: When Drupal A detects a change that should be sent to Drupal B make a service petition to a service on Drupal B. You have to set up the service on Drupal B and the code that consumes the service in Drupal A.

  • Exposing info from Drupal A: A simpler option is to export the data in Drupal A as a View and Drupal B access the URL to check new data and import it, using Drupal cron. You can protect the URL with Basic Auth allowing only local connections.

You can even combine (for example, use Migrate but instead of connect directly to the other database consume data from a View form Drupal A).

Disclaimer: I've not tested other modules to copy content, may be there's a module that suits your needs, I'm extending your current solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.