Error when migrate VM to new server with different MySQL version (MySQL 8)

Operating system: Ubuntu
*OS version: 20.04.2 LTS

I’m trying to migrate VM from server running with Ubuntu 16.04.7 LTS (MySQL ver: 5.7.33-0ubuntu0.16.04.1) to new server (Ubuntu 20.04.2 LTS - MySQL ver: 8.0.25-0ubuntu0.20.04.1) but got an error:

Error: SQL grant all on `wp\_olddb`.* to 'newdb'@'localhost' with grant option failed : You are not allowed to create a user with GRANT

I searched for many topics but cannot find the right solutions. Please help me!

You’re migrating a Wordpress site? The easiest way on earth to do that is with the Wordpress migration tool.

You simply install that plugin on your old site. Do a backup with it, download it. Install Wordpress on the new virtual server on your new server, install the plugin there, upload the backup from the other server that you downloaded and you’re done.

I’ve used it at least 50 times and never once had an issue. The only issue you may have is if you have a very large site. I think the default plugin has a limit of 3 GB. If your site is larger than that let me know. I have a version of that plugin that’s old and goes up to 12 GB.

I have many WordPress sites and other PHP sites. Not just once, thank for your suggesstion.

Hello,

Are you restoring a backup as a domain owner or a master administrator?

Also, is this backup re-creating a domain, or just overwriting an existing one?

Ofcourse, I login as root and follow this tutorial: Migrating To a New Server | Virtualmin

This is a full backup from old server and make a migrate to new fresh server (whole server), everything work fine except create user step. I think that if virtualmin change command when create user that will work.

Can you please elaborate?

Did you install Virtualmin using official install script (on new Ubuntu 20.04 server)? If you go to the console, and run:

mysql -u root -p

… will you be able to login providing the expected root password? By going to Servers ⇾ MySQL Database Server module, can it connect to a database? This is a local database or a remote?

I have Ubuntu 16.04. I will try doing a migration tomorrow of WordPress website to reproduce an issue.


Out of curiosity if you run:

systemctl force-reload mysql

… and try to restore a backup again – does it happen to work by any chance?

I try both, but nothing work. Now I can confirm that when I re-install Ubuntu 18.04 in new server (come with MySQL 5.7), everything work!

That plugin is out of date, just had few clients with this issues… manually backup would have no issues.i think it’s out of date.

Nevertheless just create bash script to do this for you every night and you shouldn’t have a trouble, just posts, comments if you still use them and of course media files, you cannot go wrong with it

What pluging are you talking about?

@iliarostovtsev … that one

Exit I did not include the link eh… Error when migrate VM to new server with different MySQL version (MySQL 8) - #2 by Gomez_Adams

This plugin was updated just a week ago and has 3m+ active installations, so it doesn’t look outdated.

Please read again. I have MANY sites in server so I cannot use that for backup 50+ websites then re-config, it’s take so many times. So I want to migrate whole server. I know this plugin and other plugin, it’s not about functionality. Thank for your suggestion.

I really tried to reproduce this issue but I couldn’t – it just works for me with default settings. I tried revoking grant permissions from MySQL root user using Servers ⇾ MySQL Database Server: Edit User page, and then I could get a familiar error you were reporting. However, I don’t expect you having no grant permissions for a root user, yet I recommend double checking on that. Also, I assume that you have latest Webmin 1.973 and Virtualmin 6.16 installed?

It would be better to get a remote access to your system to have a closer look at a problem and/or get your backup file for the start, so I could try to restore it using my Ubuntu 20.04 instance. You can PM me login credentials and/or download link for your backup file.

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