Failed to migrate virtual server (CPanel)

Current new server is running Ubuntu 20.04.1 LTS with the latest Webmin/Virtualmin

Old server is CentOS 7.9 with MySQL 8.0.23 however, when I go to import the backup we receive this message

Re-creating MySQL users …

Failed to migrate virtual server : SQL grant all on <database>.* to ‘<database_username>’@‘localhost’ with grant option failed : You are not allowed to create a user with GRANT

I see there was a previous discussion November 2020 but the person was using an older version of MySQL Our old and new server have the same MySQL version. Curious as to how we an resolve this so we can import the websites from the old server to the new.

Any suggestions would be greatly appreciated.

I have tried this solution but it did not work

Try this

1 Like

Thank you for the additional information.
I am seeing the database and user. I granted permissions but it seems I cannot Preview Website of a WordPress or Ecommerce website, is that correct?

When we Preview Website on any WordPress or OpenCart websites it says “Internal Server Error” Is that normal since it is a PHP/MySQL website?

Server is NOT live as we are just trying to migrate data at this point.


Personally, call me old school, but I never use the import functionality. I rather do the following.

  1. Provision account on new server.

  2. Backup website files, databases and email off old server.

  3. Upload website to new server (as if it were a new site).

  4. Create database on new server, then do a standard table import.

  5. Upload email to new server (assuming they use the same format – typically I rsync mail content to retain modified times and read status).

Anyways, I realize this doesn’t actually answer your question, but when all else fails go ole school.

Best Regards,
Peter Knowles | TPN Solutions

Professional, Affordable Technical Support –

1 Like

You should not see the error in preview. This is not normal. Normal is to see the website on a temp url instead of its domain.

Could you share what the error logs say after you trigger an error on preview?

Thank you all for the suggestions.
I was able to resolve the issue. See below for my solution. May not be the best but it worked for me.

Some Background Regarding this Problem

I have a CentOS 6 server running MySQL 5.5. When we tried to migrate using a backup from CPanel it would do the same failure. From what I read I should have MySQL 8 on the old server due to the changes from 5.5 to 8.0.

So we made the changes and upgraded from CentOS 6 to 7.9 and did the in place upgrade from MySQL 5.5 to 8.0. Checked websites and then did a full backup.

We tried to install the backups after the upgrade to the old server and they failed with same message.

When I searched the Databases I saw that they were installed and that a user was created, however it was a different username.

In example it created database while the original from CPanel was _

I went into the configuration files for two websites. Changed them to the new name and password and when I went to Preview Website they worked!

The issue I was having with regards to the Internal Server Error was due to customized htaccess files that were forcing the website to their full domain name.

This seems to have resolved the problem and tomorrow morning I will do a full migration.

Thank you all again for the suggestions!


Well done, @mattvanderhoff and thanks for sharing the solution with us

1 Like

I had issues with my migration from Centos/CPanel/MySQL to Debian/Virtualmin/MariaDB as well.

I had to fix a few things:

  • Fix database/user names as they had been imported with a “/” character that needed to be removed…
  • Reset passwords for each as the hashed passwords didn’t come over smoothly.
  • Update the socket MariaDB was trying to connect on in the conf files and my PHP scripts to the new location.

Hello @dmcortez and welcome to the community.

Thanks for your feedback and the workaround for the glitches in the migration from cPanel.

What a great debut post this is. :clap:

Hi @calport I did not know you had issues with migration from c panel, how did you fix it? Can you provide some sort of how to or perhaps any other way? As you glorified steps, I cannot see them here or elsewhere. Please share at this time and get something useful back to community so other could benefit too. Disclaimer: I never used cpanel for myself. I deal with its issues successfully. There are some issues you would likely run into when you do upgrade update plus some other things. Although @dmcortez did correct things for current release os that os.

Wow you switched from MySQL to MariaDB? That I did not even want to try as I was having issues with my migration.

Migrated from CentOS 6/CPanel/MySQL to Ubuntu20.04.1LTS/Virtualmin/MySQL

Your fixes are similar to mine minus the “Update the socket MariaDB”

  • Fix database/user name that was created when migration failed. Put those new user name into the configuration files of websites (WordPress & OpenCart)
  • Reset password for each MySQL user and change it in the configuration files of websites.

Glad you got yours resolved.

I recently moved a domain from Virtualmin that was using MySQL to CPanel that was using MariaDB.

Originally, I used PHPMyAdmin to export the database. When I imported that into the new MariaDB it had errors in it. Most things worked but some things didn’t. I couldn’t figure it out so in desperation I went back to Virtualmin and used the back up database in Virtualmin, imported that into the new MariaDB and it worked perfectly.

I have no idea why. Just FYI.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.