Server migration how to use the existing configuration during setup

Roberto

Verified User
Joined
Apr 6, 2013
Messages
126
Location
London
Hi

I'm preparing to migrate my VPS server to a new provider. I have done it before from scratch a few times. I would like to run the installation with predefined options found on my existing server. Can I somehow export the existing settings or copy the directadmin.conf file and place it somewhere to be read by the setup.sh on the new server?

Regards
 
OK, I am trying to install in advance of the license getting assigned to the new IP. I used this option.

echo 1 > /root/.skip_get_license

Then I used

cd /root
wget directadmin.com/setup.sh
./setup.sh 123 123456 host.name.com eth0 1.2.3.4

(changed the license and hostname details and IP to my new server)

Immediately after running, I got this error:

.170.244
-bash: ./setup.sh: Permission denied


Should I run the ./setup.sh without the options after it, so it skips the license step?
 
Ooops! I didn't enter the command "chmod 755 setup.sh" which wasn't in the instructions anymore. It used to be. DirectAdmin is now installing on the new server on its own without me entering anything, which was the desired outcome.
 
which wasn't in the instructions anymore. I
I don't even see the other instructions in the new docs anymore. Pity for newcomers.
Maybe it's not needed with the curl command presented there, I'm not into curl, but not everybody wants to use the auto feature.
 
I had a big headache.

I uploaded my backed up admin_backups folder to the new VPS server. I ran the Restore for all accounts, including the admin account itself. This then went and wiped the admin password. As a result, I could not access the server anymore. SSH wouldn't allow me to login and likewise, the admin area of the browser wouldn't allow it.

I literally had to scrub the VPS server and start again.

The lost password feature is disabled by default. If any of the DirectAdmin devs read this, I would highly suggest this is on by default and users make a choice to remove it. It caused me a massive headache, as this particular VPS provider does not allow a back door to get to root if you disabled the root account from access SSH directly. What a big headache this was.

Something off about restoring the admin user from the previous VPS server which wipes the password. I was using the same password that was on the old server, so restoring the admin backup should not have locked me out surely?

As a result of the Lost password feature being off by default, I have spent far more time than was necessary on this, and all the websites have been inaccessible on this VPS whilst I do this whole thing twice.
 
when I moving admins account - it always restored pass from backup. Also don't disable root access till you configure all things, or replace root by another user, also you can change ssh port and enable port knocking.
 
Thanks, Zhenyapan

Good advice. Second time around, I did not disable root yet. I did restore the admin, but the backed up admin password was not accessible. With root still in use, I ran the command passwd admin, but I found I was still locked out. I checked /etc/ssh/sshd_config and AllowUsers admin was in there, so not sure what was wrong this second time around stopping me from logging in.

In the end, I just ran the /setup.sh command again with the relevant options in the line and over-wrote the install. It prompted me that there was already an install and if I wanted to go ahead and recreate the admin account, which I did. It's all working now.

In future, I won't restore the admin. Something unknown went on that locked it out of sshd even when root reset the admin password. I only wanted to restore the admin account because I thought I'd see the old user packages in Reseller if I did. I'll have to recreate those manually now.

It's all working now, and I was able to remove root access from sshd.

What I'd like to know, if there is a way to export User Packages from the old server which is still running, at least via the command prompt? Although the DIrectAdmin license is no longer linked to the old server.
 
Last edited:
maybe at admin stored old domain and incompatible settings, so if there are no websites (I don't create any domains at admin account) there is no need to restore it, just configure manually new admin as you want.
 
I create domains with the admin account in Reseller mode. The reason for me wanting to restore the admin account was to get all the existing user packages. I have done in before with server migrations without the issues I had on this VPS provider.
 
I'm copying packages from:
/usr/local/directadmin/data/admin/packages/
/usr/local/directadmin/data/admin/packages.list
/usr/local/directadmin/data/users/admin/packages/
/usr/local/directadmin/data/users/admin/packages.list
 
Yep! that worked. I have a vague memory of having to do this a long time ago once.

Thanks! (y):D
 
Back
Top