Hi,
I have a 5x site that uses Usernode. Each Usernode content type has a CCK field "about me". Over the last 3 years people have entered a lot of information in their Usernode contnet type.

So in 6x, the Usernode content type will become the content of Contnet Profile module.
But here's the dillema:
If I uninstall Usernode before the upgrade, then I will loose the usernode contnet type and all the data that people have been entering.
If I don't uninstall the Usernode module and upgrade the core to D6, then I will still have a dormant "Usernode" table left in my MySQL database, and probably other elements of Usernode inside my database. From another issue, I've read that this lead to a significant slowdown for somebody's website performance.

I would like to kindly ask you: what is the most correct and cleanest procedure for D6 upgrade for a site that is using Usernode?
(So, in short, I want to get rid of Usernode module completely before the upgrade to D6, but I also want to keep the usernode content type and all of its data)

Please let us know which steps we must take in a case like this?

Many thanks in advance!

Comments

vm’s picture

Based on my reading of components involved the content_profile.module replaces the nodeprofile.module not usernode.module.

content_profile.module allows upgrading fron nodeprofile.module per the content_profile.module project page.

usernode.module based the developers statements here: http://drupal.org/node/249109 is no longer required as views.module can list users.

I'd test the upgrade on a test site to ensure the production site remains unharmed. This will allow you to work through any issues you may have.

drupalina’s picture

Hi,
Thanks for your reply, but it is not really answering my question.
I have read the link that you provided before, but it still does not address the question of an upgrade in terms of data migration.
The problem is that my Usernode contnet type has an additional CCK field attached to it called "About me", which is where people have entered a lot of data over the years. On my simulation 5x site, when I uninstall the Usernode module, the usernode content type and all usernode nodes are deleted. So I need a way to completely uninstall the Usernode, while also preserving the data (the title of the usernode and the data in the CCK field "about me").

None of this is outlined in any of the documentation.

Any suggestions?

vm’s picture

It wasn't offered as an answer merely a theory which could be tested on a test site while waiting for fago or someone with more specific instruction.

Interesting though, according to the project page of this module the usernode is empty and is simply a placeholder. I would have thought the content type would have been provided by the nodeprofile.module

Unfortunately, I can't work up a step by step as I have no D5 sites left. If this is pressing a test site would prove fruitful until fago or someone who upgraded other than myself, with more of a step by step, can answer your question in specifics.

from my memory of when I did this well over 2 years ago, I did not "uninstall" usernode before upgrading, I disabled it, upgraded to content_profile from node_profile and likely removed any leftovers from the database manually.

drupalina’s picture

Below is the original code from usernode.install file. I'm not a coder so I need help. Maybe I could comment out some of the lines here, so that the unistall goes ahead as usual, but the usernode content type and all the usernode contnet stays intact?

Can someone have a look and let me know if that could work?

<?php
// $Id: usernode.install,v 1.3.2.5 2007/10/12 14:27:09 fago Exp $

if (!defined('USERNODE_CONTENT_TYPE')) {
  //if the module isn't included yet, we need to make this define so that things are working...
  define('USERNODE_CONTENT_TYPE', "usernode");
}

function usernode_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':
      db_query("CREATE TABLE if not exists {usernode} (
        nid int(10) unsigned NOT NULL,
        uid int(10) unsigned NOT NULL,
        PRIMARY KEY(uid,nid)
      ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {usernode} (
        nid int_unsigned NOT NULL,
        uid int_unsigned NOT NULL,
        PRIMARY KEY(uid,nid)
      )");
      break;
    default:
      break;
  }

  // Prevent the promotion of new usernode objects to the front page by default,
  // by only placing 'status' (the 'Published' option) into the node options.
  variable_set('node_options_'. USERNODE_CONTENT_TYPE, array('status'));
}

function usernode_uninstall() {
  include_once(drupal_get_path('module', 'usernode') .'/usernode.module');
  // We can't call node_type_delete() because usernode_delete() forbids that,
  // so let's find and delete the usernodes manually
  $result = db_query("SELECT u.* FROM {users} u ".
                     "JOIN {node} n ON u.uid = n.uid ".
                     "WHERE n.type = '". USERNODE_CONTENT_TYPE ."'");

  while ($user = db_fetch_object($result)) {
    usernode_delete_node($user);
  }

  db_query("DROP TABLE {usernode}");
  db_query("DELETE FROM {node_type} WHERE type = '". USERNODE_CONTENT_TYPE ."'");
  variable_del('node_options_'. USERNODE_CONTENT_TYPE);
}

/*
 * Set the nodefamily maximum population, so that nodefamily knows that usernodes are lonely nodes
 */
function usernode_update_1() {
  if (module_exists('nodefamily')) {
    nodefamily_content_type_set_max(USERNODE_CONTENT_TYPE, 1);
  }
  return array();
}

function usernode_update_2() {
  //when the define was missing during installation, a wrong variable has been created
  //this update removes it
  variable_del('node_options_USERNODE_CONTENT_TYPE');
  return array();
}

Which lines do I need to comment out? And will it work?
Thanks a bunch in advance!

anupy_1791’s picture

Component: Documentation » Code
Assigned: Unassigned » anupy_1791
Category: support » feature
Priority: Normal » Critical

Hello there,
Please let us know if any solution do have.

thank You!

sfyn’s picture

Hey folks.

In my case, this was as simple as open up the usernode content type post drupal 6 migration and content_profile install, and checking that I wanted to use it as the content_profile node type. Presto, usernode info in content_profile!

vm’s picture

Assigned: anupy_1791 » Unassigned
Category: feature » support
Priority: Critical » Normal
spidersilk’s picture

I'm trying to do this, but no usernode content type shows up after running the D6 upgrade. I checked the database, and the usernode and content_type_usernode tables are still there, but when I go into Content > Content Types, usernode is not listed there.

Is there something I need to do to make it show up there? I thought about simply trying to create a new content type called that, but I'm worried that if I do that it might overwrite the existing data...

mariano.barcia’s picture

I'm experiencing the same issue as @spidersilk in #8

sfyn’s picture

Turns out, I forgot a step in #6. I needed to run a query to change the module column values in my node types table for usernode:

UPDATE node_type SET module='node' WHERE module='usernode';

I have documented my steps in this handbook page:

http://drupal.org/node/1129874

sfyn’s picture

pomliane’s picture

Status: Active » Closed (won't fix)

This version of Usernode is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.