Move Domain between Users

mmerlin

Verified User
Joined
Jul 26, 2004
Messages
75
Location
Melbourne, Australia
Hi All,

Does anyone know how to move a domain name between user accounts?

One of my users who has several domains, sold a company (and the associated domain name).

The new company is happy for me to host the new domain name, but I need to separate the domain from the original users's account.

i.e. I would like to create a new user account and move a domain from the old user to the new user account (keeping all email accounts and the website intact).

Thanks for any suggestions.
 
After reading this thread
http://www.directadmin.com/forum/showthread.php?s=&threadid=3008

I have downloaded a backup for the user and looking at what actually gets backed up

Also, after reading this thread on moving users (not domains)
http://www.directadmin.com/forum/showthread.php?s=&threadid=796


I have come up with the beginnings of a procedure to move a domain from one user to another

however I am still guessing a bit....

here is what I think would need doing so far...


In this example, assume I want to move the domain abcd.com from the old username u1 to the new username u2.

Code:
1.  Move website 

mv /home/u1/domains/abcd.com   /home/u2/domains/abcd.com

Chown website

chown -R u2:u2 /home/u2/domains/abcd.com
chown u2:apache /home/u2/domains/abcd.com/private_html
chown -R root:root /home/u2/domains/abcd.com/logs
chown -R root:root /home/u2/domains/abcd.com/stats


edit domain.conf (as found in backup file... but where is this on the server???)
change the username= to u2



2.   Move email accounts

move symlinks?
mv /home/u1/mail/abcd.com   /home/u2/mail/abcd.com

chown -R u2:mail /var/spool/virtual/mail/abcd.com   


? do I need to do anything to  etc/virtual/



3.  some other files?

mv /usr/local/directadmin/data/users/u1/domains/abcd.com.ftp  /usr/local/directadmin/data/users/u2/domains/abcd.com.ftp

mv /usr/local/directadmin/data/users/u1/domains/abcd.com.subdomains   /usr/local/directadmin/data/users/u2/domains/abcd.com.subdomains

mv /usr/local/directadmin/data/users/u1/domains/abcd.com.conf   /usr/local/directadmin/data/users/u2/domains/abcd.com.conf

mv /usr/local/directadmin/data/users/u1/domains/abcd.com.usage   /usr/local/directadmin/data/users/u2/domains/abcd.com.usage


By the way, I dont need to migrate any mysql databases (although this would be easy enough with a phpMyAdmin dump and re-create manually)

Similarly, I don't need to migrate any FTP accounts

Am I on the right track here?
 
Last edited:
About moving domains between users

I have a webmaster reseller account. Originally, I set up many domains UNDER this account, for ease of management. I would like to be able to separate these domains into individual users now. I have read the instructions in the thread posted above, but this is used to move the whole account to a new user. So when a backup is made, it backs up one whole file with ALL the domains inside. How would I take the individual domains and separate them and make them into several new users?

Thanks

Becky
 
This guide:
http://help.directadmin.com/item.php?id=58
factors that in.

All domains should be in the 1 backup.

What you'll do is use the fact that DA won't allow another domain with the same name onto the system to filter out the domains you don't want added.

You do this by creating the backup, for the domain(s) that you want moved into the next User account, you rename those domains to a different name such that the original domain name(s) no longer exist on the system. When you restore the backup into the account, only those domains that were renamed would be transffered. The rest woudl be ignored because they already exist in the original account with all the domains.

John
 
This is not working out well for several reasons.

The account I want to segregate into individual accounts is a Reseller account. It has 24 domains inside it.

1 - I have created a backup of 495.9M in size. I have tried to make a copy of this file so I dont mess it up, and my server gives a timeout error when I try to copy the files to a new directory for safe keeping.

2 - When I go into the Reseller panel, I go to Manage User Backups, and there is NO data showing there under the restore options. How come? There should be the last 4 backups in there!

3 - When you say to rename the backup under a new user's name, I dont see that it is named ANYTHING including a user's name. The name of the file is simply backup-Dec-1-2006-1.tar.gz.

4 - Side point here - there is no DA Help section for the "Manage user Backups" portion of DA.

Am I missing something? Thanks
 
Hello,

1) Increase your DA timeout to a higher value: Admin Level -> Admin Settings.

2) Check and make sure the data is in /home/reseller/user_backups
Also make sure that everything is chowned to the reseller, and not root.

3) That's a user level backup. The file data is the same, but the name is different. Rename "backup-Dec-1-2006-1.tar.gz" to "newuser.tar.gz".

4) The feature is fairly self explanitory, but we're aware that the some newer features are not listed there.

John
 
I am still having problems.

1 - solved, thank you

2 - Still no backup files showing in there. Under the Manage user Backups area in the Restore section it says

From Where
Local: ~/webmaster/user_backups/
Select Files
Location: /home/webmaster/user_backups
But there is nothing listed there to choose from.

3 - I did rename the backup file...but still can't choose it in item 2 above.

I would hate to have to download it and FTP it up for all 24 domains that I want to separate, because it is suck a large file.

What can I do?

Thanks for your help!
 
paste the output from this command:

ls -la /home/webmaster/user_backups

so we can see the permissions, and ownerhip, etc.

Also, if you're using the remote ftp transfer in the Reseller Level backups, and oversized files don't seem to work, try using a different ftp client, like ncftpput or curl:
http://help.directadmin.com/item.php?id=111

John
 
paste the output from this command:

ls -la /home/webmaster/user_backups

so we can see the permissions, and ownerhip, etc.

It says No such file or directory.
 
If the folder doesn't exist, then DA can't look inside to see what to show you.

1) Create the directory /home/webmaster/user_backups
2) chown the user_backups directory to webmaster:webmaster
3) put the user.tar.gz backup files into the user_backups directory. Also chmod them to webmaster:webmaster

If you're replacing "webmaster" with some reseller/admin's username.. the swap them out for the above guide as well.
eg: /home/bob/user_backups if the username is bob instead of webmaster.

John
 
ok, I have created the user_backups directory in the webmaster reseller file system. I have copied the backup file to that location. It is there, and now shows in the "Manage user backups" section of the reseller admin.

My next question is, on the bottom right of that Manage User Backups screen, there is a section called From Where.

From Where
Local: ~/webmaster/user_backups/

If I am going to restore in to a different user than webmaster, how do I tell it where to look? In other words, how do I tell it to restore that file INTO the NEW USER account, rather than the Webmaster account? How do I choose the user to restore into?

Thank you for your guidance, I appreciate your help.

Becky
 
DA will restore the data into the user of the name of the tar.gz file.

For example, if you have bob.tar.gz in the user_backups directory, DA will ensure the bob user exists and add the data to him. If the file is named backup-date.tar.gz and you want to restore that bacup file to user "fred", then you'd rename it to fred.tar.gz.

John
 
Back
Top