So here is workaround
Just writing here steps for future what did to accomplish this:
We had a username “Xyz Test” which we require to rename to xtest for example.
- Renamed user data directory “Xyz Test” to xtest
- Run command find . -name “Xyz Test” in nextcloud root directory, and renamed all found directories to xtest
- Took backup nextclouddb in .sql file
- opened nextclouddb.sql file in nano editor and replaced all entries “Xyz Test” by xtest in one go by using feature of nano editor.
- Saved the file and exit
- Restored nextclouddb.sql
- sudo -u www-data php occ files:scan userid or sudo -u www-data php occ files:scan --all
Now Xyz Test user can login with xtest. All files and talk conversation are there
This is the story