PDA

View Full Version : Transfer from Subdomain to Account Using WHM


<h1>
04-16-2007, 09:14 AM
Hi There

I'm wishing to transfer files from one account to another on the same server.
I have root access to my server.

The only problem is, i have stored the files I will to transfer in a subdomain of my root account.
Using WHM, you can transfer accounts to another account, but I cannot find the option to transfer from a subdomain of an account to another account, cos the subdomain falls under the account it was created. If I want to transfer the subdomain, I will have to transfer the entire account, when I only want the files within a subdomain to be transfered.
Is there any easy way to do this? I don't need to transfer databases, just files.

Please help me! I have had a complete lookaround the WHM control panel, and I cannot find this option.
Any suggestions would be greatly appreciated.
Thanks.
Rich

<h1>
04-19-2007, 12:02 PM
Hmm ok it seems this is not an easy thing to do, and will have to be done through the terminal.
Does anyone know the linux commands to move files on the server, or any links to pages that describe this process?

darksidepuffin
04-19-2007, 02:03 PM
Sorry Rich, I completely missed your post. You can do this by simply executing the following command [as root]:



mv /home/user/public_html/subdomain_folder /home/user/public_html/target_directory

<h1>
04-26-2007, 05:03 PM
Thanx for the reply demonicpuffin, sorry for the late response ..
I am a linux noob so please bear with me ;)
I do not know my target_directory, as a new account is created, and I do not know how to access this account through the directory structure. The only place I can view directories is via FTP on my root account & domain, which lists subdomain directories, but no account directories. How can I find the account directory and directory path?

Paul
04-27-2007, 11:07 AM
With cPanel a new account directory will always be /home/*user name*/public_html. So if the subdomain test.testdomain.com is under the username "test_ac" and you want to transfer it to an account called account2 you will need to create account2 through your WHM. Once the account is created log in to that account through cPanel and create the subdomain there. Then execute the following command in SSH:


mv /home/test_ac/public_html/test /home/account2/public_html/test


As a side note, you can list all your directories by running the ls command. So typing:

cd /

Will bring you to your root. If you run the ls command there in your root directory you should get something like this:


./ bin/ lib/ tmp/
home/ mnt/ sbin/ stunnel.rnd var/

So if you wanted to view the contents of the home directory you would type

cd home

then type

ls

And so on. Hope that helps.

<h1>
05-03-2007, 02:46 AM
Thank you very much for your post Paul. I have managed to copy the contents of the sub domain to a new account using PuTTy. I beginning to love the ease of use of linux commands ;)

<h1>
05-03-2007, 03:23 AM
It seems after moving the files, I cannot change them on the new account through FTP. I assume I need to change the owner or group of these files to the new account. How would i go about doing this?

[edit 1]
I thought figured it out. chown -R username folder/
This now allows me to change the files via ftp when i'm logged in with the username of the account..

But now I dont have access to view the files through the browser. What should I do to be able to allow me to execute the files through the browser, and allow the username of the account to change the files via ftp?

[edit 2]
OK after a lot of trial and error, I managed to get it working. Once the owner was changed to the account username, I then had to change the file permissions:
chmod -R 755 home/accountname/public_html
Which seems to be working now. I can edit the files via FTP, and all files are executable through the browser. Would this pose a security threat?

lailarose
05-10-2007, 06:42 PM
Hi,
I'm reading your thread and posts with interest as I am a newbie trying to do the same thing. I had a hosting site and took on some clients as I am a new web designer but now have upgraded so that each account can have it's own cpanel, etc.
This is all in the same webhosting company but now I want to move subdomain files to their own account.
I would like to do this before I change the DNS so that they don't have their site down at all.
I hope this worked for you - because if it did - I will try to mimic the advice you were given - although - admittedly - alot of it is "greek".
Cheers, Laila;)

<h1>
05-13-2007, 10:30 AM
Well i donno if i can put any more simply than Paul, i'm also a noob at this!

Fiirst thing you need to do is create a new account in cPanel.
Then you need to log into your server through a SSH client, I use putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/) for windows. Log into your server using your root username and password.
Then type
cd /
to go to your root folder.
Type ls
which will list all accounts on your server, with folders the same name as the username of the account you created.

Now you need to use the "mv" command to move files from the subdomain folder, to the www folder of your new account, using the correct directory structure.

You might need to change ownership and change the permissions of the copied files..
To check if your files have been copied, goto your server's ip, folder by ~username EG: http://196.38.88.48/~newusername/
That will allow you to view the accont before DNS is changed..