database trouble with changing username

Ehsan

Verified User
Joined
Jul 13, 2011
Messages
30
I tried to change username with these commands:
Code:
cd /usr/local/directadmin/scripts
./change_username.sh olduser newuser

Username changed successfully but the database of the user crashed and it could not be repaired,
Is there any problem with change username in DA?

Any help would be much appreciated.
 
Hello,

It's still beta.

Code:
# ./change_username.sh
DirectAdmin username changing script (Beta)

So you are mostly on your own to use the script. And yes, there might be issues with renaming databases (it has been discussed here already), you might want to read the details on these forums.

it could not be repaired,

Why not?
 
Just tried to use the change user name script, I can confirm it is still BETA. It did not update the user name everywhere and I could not edit user files through the file manager after. I just used the script again to change back to the old username, everything is working again
 
Everywhere is it where? Of course it won't update your PHP/PERL scripts, so you'll need to do it manually.
 
DA Users list (at both the Admin & reseller level) still showed the old user name, clicking on it threw an error. I could get to the User control panel by inserting the new user name in the address bar manually, but when I went to the file manager and tried to edit any files, saving would cause an error that took me to a 500 error page. I didn't test it extensively, just switched back after these problems.
 
DA Users list (at both the Admin & reseller level) still showed the old user name

I'd guess it was cached, so that is why you saw the old username.

If you need to change username, you can

1. create back of the account at reseller level, so you will get oldusername.tar.gz
2. rename oldusername.tar.gz to newusername.tar.gz
3. delete account of oldusername
4. restore newusername.tar.gz

That works 100%. Of course you'll need to update PHP/PERL scripts as MySQL credentials will be updated also.


If you've got only one-two domains, then you can create a new account with the desired name and fake domain. Then move domain(s) to a new account and delete the old one. That's also working 100%. Of course you'll need to move MySQL DBs manually, and update PHP/PERL scripts as MySQL credentials will be updated also.


That's it.
 
Back
Top