Migrate non-control-panel user accounts to cPanel

AngusB

Member
May 17, 2005
8
0
151
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.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
13
313
Houston, TX
cPanel Access Level
Root Administrator
...

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.
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.
 

AngusB

Member
May 17, 2005
8
0
151
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.
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.
 

c0mr4de

Member
Sep 23, 2007
12
0
51
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..
 
Last edited:

AngusB

Member
May 17, 2005
8
0
151
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..
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.
 

c0mr4de

Member
Sep 23, 2007
12
0
51
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!