Sharing files between Domain Names


#1

I currently have a few domains hosted with Dreamhost and I would like to copy some files from one domain to another domain. I have tried doing this using SmartFTP Client but I could not find away. Does anybody know if this is this possible? If so could someone tell me how?

Regards


#2

The first question is are the two domain’s files owned by the same user? If so, it’s a “one-liner” from the shell, and you are done.

If not, it’s a two or three liner. :wink:

–rlparker


#3

Yes the two domains are on the same user account. Not sure what you mean by “one liner”


#4

AH! That’s good news on the “same user”, and not too big a deal if you didn’t get the “one liner” reference (I was talkng about typing a single command line from the shell).

Not to worry if you are not familiar with or comfortable in the shell, because this is a situation that DreamHost Net2ftp (webftp) Client can handle easily.

Just go to http://webftp.dreamhost.com and log into your account. Navigate to the file(s) you want to copy from one domain, select them, and then pull-down the “actions” choices on the upper right side of the screen and select “copy”. Type in, or browse to, the “receiving” domain’s space/dir, hit the “set all target directories” button, and click the “green check-mark”. Ta dah! All done with the first “batch”. Just repeat as necessary and you will be golden.

–rlparker


#5

I have done what you said above. (I can copy files on the same domain using this method, but not to the other domain on the same hosting account) on the page, I type the login details for the other ftp account and filling the target directory details which is fine, then I click “set all target directories” which then is reset the target directories to the domain which I am trying to copy from. It will also not allow me to browse any directories from the host I am trying to copy to.

Maybe its me doing something wrong.


#6

Well, there is the clue (which has to do with my first question). If the other domain is in “another ftp account” then the files are owned by different users, and that method I described won’t work.

That’s why I asked that first question, so I wouldn’t tell you way that wouldn’t work.

Have you ever used the “shell”?

–rlparker


#7

I am new to “shell” . I have set both users on both domains to “shell” if thats any help.

So there is no way i can copy files from one domain to another on the same hosting account using two different ftp logins.

Regards


#8

Yes, there is a way, using commands in the shell, or a combination of FTP client operations and a shell command.

  1. First, you have to set the permissions on the “source” files so that the other user can copy the files. You can do this either with the chmod command in the shell, or with the facilities of your FTP client.

  2. Second, log out of that account, and log into the “receiving” account as a “shell” user via SSH (not FTP).

  3. Once there, use the shell’s “cp” command to copy the files from the one directory to the other.

The commans should look something like this:

cp /home/username1/domain1.tld/dir_path/filename(s) /home/username2/domain2.tld/dir_path/

You will need an SSH client to connect via the shell. There is a lot of help on some of this in the DH wiki - just search for users, SSH, and shell, and read the articles that you find.

You might consider that, if this is all new to you, it might actually be easier to just log into account 1 via FTP, download the files to your computer, and then log out of that ftp account, and into the other ftp account, and re-upload the files.

–rlparker


#9

Many thanks for your help rlparker

I will download a SSH client and look at the wiki on how to do this.

I normally download the files to my hard drive then upload them the new domain, but takes a long time. I was exploring quicker and easier ways to do this.

Once again thanks for your help


#10

No problem! The wiki explains how to do all of that pretty well, and those articles should give you what you need to know to do what you want to do (make sure to look at the Unix File Permissions article too!)

If you get stuck with a particular issue, post back and ask, and I’ll try to help some more. :wink:

–rlparker