Change a DirectAdmin username fail

chronic

Verified User
Joined
Dec 14, 2006
Messages
96
First of all I hope I have written in the right section, sorry if I'm wrong.

I need to change the username for a client and I have followed this guide:
http://help.directadmin.com/item.php?id=193

However, given the errors I think there are problems in the script, also the change does not work, report below the result.
I replaced the username and the domain name for security reasons.

Code:
[root@server scripts]# ./change_username.sh oldname newname
groupmod: group 'oldname' does not exist
Can't open /etc/virtual/domain.com/majordomo/list.aliases: No such file or directory.
Can't open /etc/virtual/domain.com/majordomo/private.aliases: No such file or directory.
PHP Deprecated:  Function mysql_list_dbs() is deprecated in /usr/local/directadmin/scripts/change_database_username.php on line 71
PHP Deprecated:  mysql_list_dbs(): This function is deprecated; use mysql_query() with SHOW DATABASES instead in /usr/local/directadmin/scripts/change_database_username.php on line 71
Starting MySQL..                                           [  OK  ]
Can't open /home/newname/domains/*/awstats/awstats.pl: No such file or directory.
[root@server1 scripts]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: AH00543: httpd: bad user name oldname

What should I do? It could be my problem? I have to send an email to the staff of directadmin to report the problem or they respond here on the forum?

Thanks
Michele
 
Hello,

I do see a few bugs there:

1) The mysql_list_dbs.. which we've used in the past appears to have been depreciated, we'll have to change that to use the "SHOW DATABASES" method.
2) Somewhat related, we're also planning on changing it to use the RENAME TABLE method, to span over to the new DB, but it's not yet done (high complexity to solve rare cases).

3) I believe the main error you're running into (system level) would be the fact that it cannot find the old group.
The old user and the old group must exist first, before they can be renamed to the new value.
I'm not too sure why they don't exist.. perhaps it was done halfway already then stopped.. not too sure.


For the box in it's current state, we'll need to know where it's at.
Does the old user or the new User exist?
Code:
id olduser; id newuser

If the newuser does exist, does it exist in DA?
Code:
cd /usr/local/directadmin/data/users
ls -la newuser

The users.list might also need to be repaid:
http://help.directadmin.com/item.php?id=251


For MySQL.. probably the easiest at this point, assuming the "olduser" database still exists, would be to create the DB in DA.
Then use a mysqldump old_db > file.sql, and mysql new_db < file.sql call to dump and restore from the old db to the new db. (the mentioned mysqldump/mysql command need more info)
http://help.directadmin.com/item.php?id=180


John
 
Back
Top