Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8654155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:42:59+00:00 2026-06-12T14:42:59+00:00

Can I pass the node object $node to another Drupal instance (another Drupal site)?

  • 0

Can I pass the node object $node to another Drupal instance (another Drupal site)?

  • Lets just forget about Node Conflictions .. and problems etc..
  • Is it POSSIBLE to pass a Drupal Node Object to another Drupal Instance?
  • How can I pass that Node to another Drupal Site?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:43:01+00:00Added an answer on June 12, 2026 at 2:43 pm

    Speaking purely hypothetically, you could. I am going to ignore a lot of the problems you would face in attempting this (max POST size, assuming both sites have same node types & fields, ect..)

    On your Drupal site “A” (your sender), I’m assuming your script is a PHP script within a custom module called “mysendermodule” and on your Drupal site “B” (your receiver) you have a custom module called “myrecievermodule”.

    Your sender module would need to encode the $node object in a way that it can send it as a POST variable (again, we are ignoring the issue of the MAX Post size). I’m going to choose to json encode it followed by base64 encoding to remove any special characters. Your Sender module would make a POST request to the Destination using cURL. It would then wait for a response to see if it was successful, Like so:

    <?php
        function mysendermodule_sendNode($node){
            $destination = "http://www.otherdrupalsite.com/recieve-node";
            //encode the node to be sent
            $encoded = base64_encode(json_encode($node));
            //built POSTVARS
            $postvars = 'node='.$encoded;
    
            //make cURL call to send the node
            $ch = curl_init($destination);
            curl_setopt($ch,CURLOPT_POST,1);
            curl_setopt($ch,CURLOPT_POSTFIELDS,$postvars);
            curl_setopt($ch, CURLOPT_HEADER      ,0);  // DO NOT RETURN HTTP HEADERS
            curl_setopt($ch, CURLOPT_RETURNTRANSFER  ,1);  // RETURN THE CONTENTS OF THE CALL
            $return= curl_exec($ch);
            curl_close($ch);
            //see if we got back a success message
            if ($return == 'TRUE'){
                return true;
            }
            return false;
        }
    

    Now on your other Drupal site (the receiver) with the custom receiver module. It would first need to create a destination point to receive the node, using the menu hook. It would then need to decode the received node, programatically insert it using node_save and returning a success or failure. Like so:

    <?php   
        function myrecievermodule_menu(){
            $items['recieve-node'] = array(
                'page callback' => 'myrecievermodule_recieveNode',
                'access arguments' => array('access content'),
                'type' => MENU_CALLBACK,
            );
            return $items;
        }
    
        function myrecievermodule_recieveNode(){
            $message = 'FALSE';
            //did we recieve a node?
            if ($_POST['node']){
                //decode it
                $node = json_decode(base64_decode($_POST['node']));
                //does it have a valid node object field?
                if (isset($node->title)){
                    //attempt to save it (will return nid if successful)
                    if (node_save($node)){
                        $message = 'TRUE';
                    }
                }
            }
            //return just the output of message.
            ob_clean();
            ob_start();
            echo $message;
            ob_end_flush();
            exit;
        }
    

    Again this ignores a lot of the many issues you would face in implementing this, however it is possible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Quick question about the Jade template engine: How can you pass node.js variables to
in MongoDb I can pass a predicate to an queryable instance for example DataBase.GetCollection<BsonDocument>(entity)
When importing a node from one DOMDocument Object to another DOMDOcument Object, the nodeValue
You can pass special strings into jQuery's Datepicker class setDate() method like +7 which
In JSF 2 you can pass around ids, Strings other things that can be
I know you can pass arguments through the RunWorkerAsync function call when you first
I know that I can pass a string as the second parameter to the
During a search you can pass some data to search manager by using the
If I have a auto_ptr I can pass it for a reference?Like: auto_ptr<MyClass>Class(new MyClass);
Is there any way that I can pass arguments in selector? example: I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.