New Cluster with data

I am starting a new cluster after upgrading OS. The server has the data in the datadir can I start the cluster or will there be some sort of conflict?

2 Likes

Make sure that you bootstrap the first node and it will use the data in the datadir to form the first node of the cluster. Then start node2, and node3. They will join and SST if necessary.

1 Like

I tried bootstrapping from my data but I am getting the following error. Cannot boot server version 80023 on data directory built by version 80026. Downgrade is not supported mysqld: Can’t open file: ‘mysql.ibd’ (errno: 0 - ) I data in the datadir is from myswl 5.7 and I am trying to go to 8.0. How do start with the data I currently have, is there a file in the datadir that I can delete?

1 Like

According to the error you pasted, you are not on 5.7. You are on 8.0.26 “data directory built by version 80026” and you are trying to start 8.0.23 “Cannot boot server version 80023”

Once you start 8.0 on top of a 5.7, mysql automatically converts to the new data dictionary. Downgrade is impossible from 8.0 to 5.7. You must perform a complete 5.7-backup restore.

1 Like

I am not trying to down grade from 8.0 to 5.7. My new server is 8.0, data in the datadir is from 5.7 I took down the 5.7 server but kept all of the data. I am bootstrapping the new cluster with data from 5.7 and I am getting the error Cannot boot server version 80023 on data directory built by version 80026. Downgrade is not supported mysqld: Can’t open file: ‘mysql.ibd’ (errno: 0 - ). Are there files I can remove in the datadir that will allow me to bootstrap the 8.0 instance with the 5.7 data.

1 Like

What you are saying and what MySQL is telling you are two different things. You are saying the datadir is 5.7, but mysql is telling you that is is NOT 5.7 and in fact it is an 8.0.26 datadir.

MySQL is reading your datadir and it is NOT a 5.7 datadir. It literally says so in the message:

data directory built by version 80026

Can you please install 8.0.26 and attempt to start MySQL?

1 Like

I am attempting to start mysql 8.0 here is what I get when I check the version. mysql Ver 8.0.23-14.1 for Linux on x86_64 (Percona XtraDB Cluster (GPL), Release rel14, Revision d3b9a1d, WSREP version 26.4.3)
I copied the datadir from a mysql 5.7 install to the mysql 8.0 install. I setup the my.cnf file on mysql 8.0 and now I am attempting to start mysql 8.0 and
I am getting Cannot boot server version 80023 on data directory built by version 80026. Downgrade is not supported mysqld: Can’t open file: ‘mysql.ibd’ (errno: 0 - )
Can I delete the mysql.ibd.

1 Like

Can you please install 8.0.26 and attempt to start MySQL?

1 Like

I am not certain I can install 8.0.26. The administrators had a difficult time getting 8.0.23 to install. Is there any reason why 8.0.23 wouldn’t work?
I will ask for a fresh install because I am using an empty datadir and I am still getting the error.

1 Like

Ok, that is unusual. If MySQL does not see a proper datadir it will attempt to create one. Can you verify the datadir path settings in /etc/my.cnf and verify that path is empty?

1 Like

I am using Percona XtraDB Cluster if i use Percona Server 8.0.26 I would not have the ability to cluster. I do have the latest XtraDB Cluster, I will restore to my development area and do a mysql dump, those files should work once I get the datadir cleaned.

1 Like

Sorry, I did not realize PXC 8.0.26 was not available.

Do you have a backup from which you can restore? Or what about the other PXC nodes? The bottom line is that you cannot use this datadir; period. It flat out won’t work due to the version of the data dictionary. This is the error message you are getting and there is no way around this.

If you don’t have a backup, you need to install the latest Percona Server 8.0.26 so that it will start up, take a logical dump, stop and uninstall PS, erase data dir, install PXC 8.0.23 (which will create a proper 8.0.23 data dictionary), then import data.

1 Like

By logical dump you mean mysqldump? If so that is the route I am going.
I do have backups, but if I extract them to the datadir wouldn’t that make it that datadir unusable because of the different versions?

1 Like

mysqldump is a logical backup which requires a running mysql server to restore. So if you start a brand new 8.0.23 (with empty datadir), this will initialize the datadir and create a proper 8.0.23 datadir. Then you can import your data. After that, stop the other two nodes. Then stop this node and restart it in bootstrap mode. Then start node2 and 3. They should SST from this node.

1 Like

I have a development server and I will extract and do a mysqldump, move dump to new server. Get a clean datadir start it up (hopefully it works) then restore my dump on the new server.

1 Like

I have a backup, can I extract and then xtrabackup --prepare --target-dir=directoryOfData then innobackupex --copy-back /path/to/BACKUP-DIR all on the new node. Would that work? The datadir should I am guessing initialize the data to mysql 8?

1 Like

Stop using innobackupex completely. Everything is xtrabackup now, including copy-back function.

Your backup may contain the mysql system dictionary, which will probably put you in this same situation again. You really need to use a logical backup on a brand new install of PXC8.

1 Like

Noted. My databases are large so was trying to shortcut the extract, restore, dump process. My assumption was using innobackupex now xtrabackup to do the copy back, that it would prepare the directory for the newest version.

1 Like

I suspect what happened is that you installed Percona Server 8.0.26, which upgraded the existing datadir, then you installed PXC 8.0.23 which cannot read a datadir version 8.0.26. When this happens, the only option is to restore from logical backup as the physical backup taken by xtrabackup will have the 8.0.26 version datadir.

1 Like

I am guessing that is what the installers did.

1 Like