How to change Drupal node content type without loosing PageRank and incoming links

Suppose, you have a very popular "simple article" on your Drupal-powered site. May be, this is a "page", with a lot's of comments and incoming links. Suppose, you have decided to add a couple of child articles to it. To form the tree-like structure like in the Book module. You'll not be able to do this since only "book" pages can be a root of the book. This is only one of the cases when you have to change the content type of the existing node.

The first solution, coming to you head, would possibly be very simple: just create new node and copy the whole content from the original one.But wait. You don't want to lose the commens and incoming links, do you?

Of course, you can go to the drupal.org and enter something like "change node type" in the search field. You will find the nodetype module.

Please do not use it in the production systems.

It just changes a little record in the DB without changing any structure of the node. For example, after I have tried to change "Page" into "Book", it has changed. But the outline feature just have not works after that change. The node just starts to be named "book".

We have to live with the fact that it is impossible to change the node type. Instead we can try to achieve the same goal by creating new node. We have no other choice.

Okay. New node is created. But we have old comments and old incoming links still.

No problem. All comments can be easily transfered to the new node using Comment mover module.

There is a little trick in the aliases feature of the drupal. It accepts the local addresses. Even the existing ones. Let's take by example that your old node's number was x and new node's number is y. So in order of the new node to look like it resides on the old address, you can establish URL alias between old node (node/x) and new node (node/y). As a result, when user will request yoursite.com/node/x, he will actually receive yoursite.com/node/y. Of course, there will be impossible for the regular users to access the old node contents. On the other side, it seems, this is exactly what we need. Users will even can not notify the changes.

And of course, if your old node has an alias previously, you should change this alias with the new node.

Comments

Thanks

Thank you so much. Very help me.... :)