We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14167
    • 55 Posts
    Hi,

    I have an old website with over 500 subscribers which I need to move over to Modx. the passwords aren’t encrypted, but I do have some other fields I need to pop into mode that I have added using ’logins’ custom fields.
    Any help, or ideas would be welcome on this... Guess I will need to convert the passwords first?

    Thanks in advance...
      Linux, PHP 5.2, MySQL 5.0, Revo 2.2.0-pl2
      • 3749
      • 24,544 Posts
      You might checkout the Provisioner package, which I think will import users from Evo to Revo. Provisioner doesn’t run in the current version of Revo, so you’d have to install an earlier version, import the users, then upgrade to the current version.

      The "custom" user fields will be go in the ’extended’ field of the user profile table in Revo. I don’t know whether Provisioner will handle them or not.

      The other alternative would be to export the relevant tables as CSV files, then write a custom snippet to create the users and user profiles from them, but it would not be a trivial task. I think the passwords will be encrypted automatically when you call $user->set(’password’, $value);
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 23334
        • 2 Posts
        You might consider parsecsv. I don’t know how MODx will handle the passwords.

        <?php
        //
        // Input Roster.csv format:
        // username, password, fullname, mobilephone, phone, email ...etc...
        //
        include 'C:\Server\Sites\ccutest\assets\inc\modxClasses.php'; // *** REMOVE ***
        //
        require_once('parsecsv.lib.php');               # Include the parseCSV class
        $csv = new parseCSV();                          # Create a new parseCSV object
        $csv->delimiter = ",";                          # Use the comma delimiter
        $csv->enclosure = '"';                          # Use the double quotes enclosure
        $csv->parse('Roster.csv');                      # Parse the Roster.csv
        //
        foreach ($csv->data as $key => $row) {  
        
        //  while ($row[username] !== "") {
        
          /* Setup the user */
        
            $user = $modx->newObject('modUser', array('username' => $row[username]));
            $user->set('active', $row[active]);
            $user->set('password',$row[password]);
        
          /* Setup the user's profile */
        
            $profile = $modx->newObject('modUserProfile');
            $profile->set('fullname', $row[fullname]);
            $profile->set('address', $row[address]);
            $profile->set('city', $row[city]);
            $profile->set('state', $row[state]);
            $profile->set('zip', $row[zip]);
            $profile->set('mobilephone', $row[mobilephone]);
            $profile->set('phone', $row[phone]);
            $profile->set('email', $row[email]);
            $user->addOne($profile);
        
          /* save the user to DB */
        
            $user->save();
        //	}
        }