[HOWTO] Move users from server 1 to server 2

Cybex

Verified User
Joined
Dec 30, 2005
Messages
53
Hi guys,

I would like to share my procedure to move users from server 1 to server 2. It might be handy for server admins that need to do this one day.

Regards, John

---

Procedure to move users from server 1 to server 2.

1) Make sure TTL (DNS) is low before starting. It would be wise to do this a day before the actual move.

Code:
cd /usr/local/directadmin/data/templates
perl -pi -e 's/14400/100/' named.db
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue

2) Disable Multi Server Setup on server 2 if you configured it.

3) Temporary create an FTP user for ADMIN to make life easier for restoring. On server 2 do this:

Code:
wget http://www.castaglia.org/proftpd/contrib/ftpasswd
chmod +x ftpasswd
./ftpasswd --passwd --name=admin --uid=501 --gid=502 --home=/home/admin --shell=/bin/false
cat ftpd.passwd >> /etc/proftpd.passwd

4) Create a backup on server 1 (Admin Backup/Transfer) via FTP to server 2 in directory /admin_backups. (use the login details created in step 4)

5) Remove DNS entry for the user(s) you are going to restore on server 2.

6) Restore the backup on server 2

7) Enable Multi Server Setup on server 2 and update the DNS to the other servers:

Code:
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue

8) Remove the admin user from /etc/proftpd.password

9) Restore TTL in DNS to default settings on your primary DNS server:

Code:
cd /usr/local/directadmin/data/templates
perl -pi -e 's/100/14400/' named.db
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
 
Last edited:
A TTL of 100 may be so low that some ISPs will ignore it (AOL used to do this I haven't checked any lately) and use their own. We use 600 (ten minutes) all the time and we tell our users to expect up to 30 minutes of disconnectivity during server moves, and have had neither problems nor complaints.

Note I'm replying only to this one point and have not studied the procedure in any way.

Jeff
 
Hi, it's a good guide. I have a few notes & questions to add. I believe your guide was written for a brand-new Server 2. With regards to that;

  1. Why do you need to have the Multi-Server Setup option configured before-hand? I do not think it is necessary for transfers between servers. It is only used for DNS replication.
  2. Why do you need to create a new FTP user for transfer purposes, when DirectAdmin specifically has the default "admin" user to access /admin_backups?

I think a few steps are unnecessary, but other than that the guide is a standard to follow. Just the last bit needs some clarification on where to run the DNS rewrites; Server 2 I believe?
 
1. You are right, it would probably be better to have NOT configured Multi Server Setup because it brings extra work.
2. The admin user is not able to use FTP because it's not in the proftpd.password file. Therefore I created a user with password.

The DNS rewrites have to run on the primary DNS server. I will update the guide, thanks for your input.
 
1. You are right, it would probably be better to have NOT configured Multi Server Setup because it brings extra work.
2. The admin user is not able to use FTP because it's not in the proftpd.password file. Therefore I created a user with password.

The DNS rewrites have to run on the primary DNS server. I will update the guide, thanks for your input.

My pleasure.

If I am not mistaken, DirectAdmin's default "admin" account does have FTP access upon installation. In any event, it can be easily enabled through the Control Panel, so this is why I didn't see the need to create a new FTP account.

If you are rewriting DNS values on Server 1, it may not be a wise idea, especially if you are relocating and enabling Multi-Server Setup. It all depends: are you purging the existing user accounts on Server 1 when they are moved to the Server 2? Will Server 1 then become the DNS slave for Server 2, using DA's Multi-Server Setup replication?

What I would recommend is updating the IPs for a particular user/account/domain with the new DNS/NS IPs on Server 1, so everything gets sent to Server 2 (such as mail for one). I would then keep the old user account on the server for two purposes: DNS "redirection" and a backup of all files in case something goes wrong during the transfer (or email gets sent to Server 1 due to delayed DNS propagation).

Or if you feel confident, you can purge user accounts on Server 1 and then add it as a MSS DNS slave for Server 2. It would then rewrite the necessary DNS values for you automatically.
 
Back
Top