Hello can I change the DB server after a few days of running openfire?

As shown below, I’ve used local mysql as my DB, but as days go on, I found mysql stores a lot of messages(I store the history mesage from the start)

And I now want to change the DB Server to AWS or some other third-party DB server providers,

How could I change the config of database ? Thanks very much, I’m now using openfire version 21(3.10.3)

Database Connection Info
Database and Version:
MySQL 5.7.9
JDBC Driver:
MySQL Connector Java
JDBC Driver Version:
mysql-connector-java-5.1.30 ( Revision: alexander.soklakov@oracle.com-20140310090514-8xt1yoht5ksg2e7c )
DB Connection URL:
jdbc:mysql://127.0.0.1:3306/openfire?rewriteBatchedStatements=true&useUnicode=tr ue&characterEncoding=utf8mb4
DB User:
root@localhost
Transaction Support:
Yes
Transaction Isolation Level:
TRANSACTION_REPEATABLE_READ
Supports multiple connections
open at once:
Yes
In read-only mode:
No

I want to add sth

1st

I want to trans my DB data from old to new

2nd

I want the new DB connected, and the old one shut down

3rd

if possible, I’d like this operation goes smoothly , and donot need to restart openfire server

Hope to hear from you, thanks