The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Migrate non-control-panel user accounts to cPanel

Discussion in 'Data Protection' started by AngusB, Dec 11, 2007.

  1. AngusB

    AngusB Member

    Joined:
    May 17, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    I have seen hints about options, but have not seen an actual complete solution for my issue. I know I must just be missing it, there must be one out there.

    I currently have a couple thousand basic linux user accounts on a server with no control panel. These accounts do not use email, mysql, ssh, or anything really besides FTP access to upload files to their /home/username directory that if in the public_html folder then appears under the url http://www.mydomain.com/~theirusername

    I want to import all these users into a cPanel system so we can start offering them more options/services including the ability to have their own domains, which they will not have when this move is done. All the accounts would all be created with the same Package (theme, quota, etc).

    I have root access to the machine.
    I have a list of the usernames.
    I can backup their user directories to move them.

    I do NOT have a list of their existing passwords in plain text, just what is in the encrypted /etc/shadow file.


    I have gotten the idea that cPanel has some sort of scripting system that might allow the creating of cpanel accounts from the list of usernames.
    I assume I can then just copy the contents of their /home/username directories to the new cpanel system (avoiding the .hidden files).


    So my questions are
    1) is there an existing script somewhere that will take a list of usernames and create accounts with a particular package? (so I don't go reinventing the admittedly simple wheel)

    2) When creating the accounts with the script I am hoping exists, can I use a dummy password in the script and then simply insert the encrypted passwords from the old /etc/shadow file into the new /etc/shadow file matching them to the corresponding usernames (not copying the file over, I am aware the userID#s will change) or is there somewhere else the passwords are used/saved by cPanel as well as the shadow file?

    Thanks.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    1) If you're willing to do a little work, you can use either the XML-API to create accounts with a particular package via a script. I'm not sure of the parameters of /scripts/wwwacct, just execute that script without any parameters to see what parameters it accepts. You may want to see if that does the job for you.

    2) Keep in mind that while cPanel/WHM does synchronize passwords for the user accounts, services such as FTP may not directly reference the /etc/shadow file. As a result, there may more involved than simply copying over /etc/shadow.
     
  3. AngusB

    AngusB Member

    Joined:
    May 17, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Is this not possible?

    I tried creating a new account and it tells me "Account Creation Status: failed (Sorry unable to proceed. Too little information *user? *domain? *pass?.)"
    Is it required for every account to have a domain attached to it?

    I want to set them up so they just appear as http://www.mydomain.com/~theirusername for now, but we can add a domain for them later if they register one.
     
  4. c0mr4de

    c0mr4de Member

    Joined:
    Sep 23, 2007
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Yeah.. Unless you use subdomains, i.e; username.urdomain.com!
    Or if you want yourdomain.com/~username, just have urdomain.com/username, by taring up there info and wget link using SSH into your new box. then untar in /home/urusername/public_html..
     
    #4 c0mr4de, Dec 12, 2007
    Last edited: Dec 12, 2007
  5. AngusB

    AngusB Member

    Joined:
    May 17, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Unless I misunderstand, you are suggesting I create one account with my domain, and then create 4500 ftp accounts under that domain, so they can ftp their files into their own directories, without having access to each others files.

    But with this setup, none of the users would have access to any of the gui tools such as file manager, traffic logs, etc. Unless I gave them all access to my login, in which case they would have access to everyones files and info.
     
  6. c0mr4de

    c0mr4de Member

    Joined:
    Sep 23, 2007
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Yeah..the only other way would be to make subdomains off your domain in WHM username.domain.com and that would be a seperate account for each person with there own cPanel/FTP etc..

    Then if they bought a domain all you'de have todo is update it in accounts, simple!
     
Loading...

Share This Page