How to restore root.admin to other admin?

Richard G

Verified User
Joined
Jul 6, 2008
Messages
13,853
Location
Maastricht
This is the case.
We want to migrate two servers which each other.
root admin on server1 has domain1.nl as primary admin domain and the nameservers are running as such too.

On server2 the situation is likewise but with domain2.nl and nameservers belonging to that.

When I create a backup of server 1, the backup is going to be:
admin.root.admin.tar.gz

Another admin name is john and the backup will normally be named:
admin.admin.john.tar.gz

When I transfer this to server 2 and restore it there, then my original root admin of server 2 will get overwritten.
I need this to become an admin on server 2, but not root admin, so it must not overwrite any settings.

Suppose I want root admin of server 1 to be named admin Foo on server 2. Is it enough to rename the backup file after transferring to:
admin.admin.foo.tar.gz?
and then restore? or do I need to keep other things in mind or do it another way?
 
Found part of a solution but still need some help.

I created another admin called admin03.
Then I used the move to reseller option, to move the users to admin03. So far so good.

But if I do a "list administrators" on the old server, it looks like the domains are still with the "normal" admin account.
Code:
admin	193.22 / unlimited	3489.1 / unlimited	0	37 / unlimited	No	
admin03	0 / unlimited	0 / unlimited	3	0 / unlimited	No
As you can see, all traffic and the 37 domains are still with admin.

How do I get all 37 domains listed under admin03? I know about the script to move domains, but that only works 1 domain at a time.

Is there a command to move all those 37 domains from admin to admin03?
So only those listed under admin03, because there are also other domains which are not listed under admin and which should not be transferred to admin03.

============

Edit: This might be difficult later on.
If possible, my first question about renaming admin.root.admin.tar.gz to admin.admin.admin03.tar.gz is that possible? Will it then restore on the other server to admin03?
 
Last edited:
Hello,

If you restore admin.root.admin03.tar.gz, DA will create the admin03 Admin account.

If you had all 37 domains in a text file, call it domains.txt, like:
Code:
domain1.com
domain2.com
domain3.com
etc..
you could do:
Code:
cd /usr/local/directadmin/scripts
for i in `cat domains.txt`; do { ./move_domain.sh $i admin admin03; }; done;
John
 
Thank you very much John.

If you restore admin.root.admin03.tar.gz, DA will create the admin03 Admin account.
Shouldn't this be admin.admin.admin03.tar.gz then? Because we can't have 2 root admin's and I don't want to merge the admins on server1 and server2. Am I correct?

And rename the users to user.admin03.username.tar.gz to restore them under admin03, correct?
 
Last edited:
Shouldn't matter much... you could.. but Admin's are the top of food chain, so root is ok.
I'd personally leave it as root... as "logically" if admin created admin03.. we don't want admin03 getting deleted if admin is deleted... although, I don't believe that would happen, but that's logically what the creator part is for.

John
 
Oke thank you for the explanation.
I didn't know you could have 2 different root admins on the same server. That's good to know.
 
Back
Top