MySQL Shell 8.0.27 or higher version. It is recommended to use the
latest version of MySQL Shell. Any earlier versions of MySQL Shell cannot import
the exports created by MySQL Shell 8.0.27 or higher version.
Access to Object Storage and an existing bucket that contains the
exported files.
A valid configuration file. If you have installed and configured
the CLI in the default location, you have a valid configuration file. If you
have not installed and configured the CLI, you must either install it or create
a configuration file manually. See SDK and CLI Configuration
File.
Your replica has enough storage space for the import.
A replica running with local-infile=ON. You
require the parameter for importing the source dump. You can disable the
parameter after the import. If you disable the parameter, restart the
replica.See local_infile.
Note
If you are importing to a DB
system replica, this parameter is enabled by default. To disable it, create
a copy of your configuration, set local-infile=OFF, and
replace your existing configuration.
Do the following to import the source data and users to the replica:
In MySQL Shell, connect to the replica, and run the following command in the
JS execution mode:
util.loadDump("prefix", {osBucketName: "bucket", threads: n,
loadUsers: true, updateGtidSet: "append"})
util.loadDump: Import data from the
specified Object Storage bucket to MySQL DB system.
prefix: (Optional) If the data is uploaded
to Object Storage with a prefix, specify that prefix in the import
command. See Overview of Exporting and Importing.
osBucketName: Specify the name of the
Object Storage bucket to import from.
threads: Specify the number of processing
threads to use for this task. The default value is 4. It is recommended
to set this parameter to the number of CPU cores available on the local
database server or twice the number of OCPUs used by the target MySQL DB
system.
loadUsers: true: Load the users defined in
the source instance.
updateGtidSet: "append": Apply the
gtid_executed GTID set from the source, as recorded
in the dump metadata, to the gtid_purged GTID
set on the replica. See MySQL Shell Dump Loading
Utility.