Transferring Users to Another Server

floyd

Verified User
Joined
Mar 29, 2005
Messages
6,255
I use Admin Backup/Transfer to move users to different servers. The problem I think is the order of the php versions on the old server do not match the previous server.

Old php 7.3 and php 8.2
New php 8.2 and 7.3

So when I transfer instead of the domains getting 7.3 like the old server they get 8.2. This has caused some problems since sites are not yet compatible with 8.2. I have to manually go in and change the php version on each site.

Is there some thing in the configuration that keeps the php version that I can manipulate so that the correct php version is set? I can write a script to check the config and change it as necessary if I know what needs to be changed. The I assume I can do a rewrite_confs and fix it in the httpd configs.
 
Just change the 8.2 to 7.3 in Custombuild and it should be fine

You mean I need to change the order of them? I have both already but in a different order. And if I change the order that will probably mess up the other users that are already on the new server.
 
Yes, normally that would do the trick, but if there are old users that were already on the server it's choosing between 2 bad ones....
 
Ok I found it. The file is /usr/local/directadmin/data/users/<USERNAME>/domains/<DOMAIN>.conf

I just need to change php1_select=2 to match the correct one on the new server. If its missing then it is whatever was the first one was the old server.
 
Users only remember what position the php selector is on, not the actual PHP version you select. Something to keep in mind whenever you're moving stuff between servers.
 
I always have the order of the php versions the same on all servers.
There is a thread which I created some time ago on the forums, which asked how to switch users to another php version.

Answered in there is how it can be done on mass. So for example switch all users currently using php3 to php2 or php2 to php1.
Might be a lot easier to switch multiple users tot he correct configuration, before making the backup.
Or even right now, easier than changing every user.conf which is incorrect at this moment.

Or... like me.. have the config on the servers the same, then you can just move users over to other servers without running in to these kind of issues.

Ofcourse... it might be harder of you have a load of servers to keep everything the same.
 
I always have the order of the php versions the same on all servers.
As I am till roundcube tell it can't update until main php lower than 7.4 :(
so in some cases better to use some script to find+replace and then rewrite confs :)
 
As I am till roundcube tell it can't update until main php lower than 7.4 :(
That is odd. I never had this issue. I did have seen it telling me it needed to be higher than php 7.4, but things happen indeed.

But yes... for some script find and replace is indeed more usefull, which is why I mentioned it. :)
 
Back
Top