Migrating to Arvancloud Cloud Database
The migration feature of the Arvancloud managed database lets you move your existing MySQL and PostgreSQL databases to the Arvancloud Cloud Database. This tool performs the migration in an integrated and secure way, with the least possible disruption and downtime.
This feature is designed for migrating critical data. By removing manual steps, it reduces the risk of human error and data loss.
The current version supports homogeneous migration:
- MySQL → MySQL
- PostgreSQL → PostgreSQL
Heterogeneous migration will also become available in the future.
Supported MySQL Versions
- Limited support: MySQL 8.0.x
- Full support: MySQL 8.3.x to MySQL 8.4.x
- Not supported: MySQL 5.7.x and MySQL 9.x
Supported PostgreSQL Versions
- Supported: PostgreSQL 10 to 17.9
- Limited support: PostgreSQL 9.6 and earlier
- Not supported: PostgreSQL 17.10 and later
Definitions
Source Database
The database whose data is moved to the Arvancloud Cloud Database. It can be hosted on your own infrastructure or by any other provider (including Arvancloud).
Target Database
A new node in the Arvancloud managed database that the data is moved to by the migration tool.
Migration Methods
The Arvancloud Cloud Database supports two migration methods. The methods available to you depend on the conditions and configuration of the source database.
Offline Migration
In offline migration, a full backup of the source database is taken and restored on the target database. To keep the data consistent, the source database is put in read-only mode when the migration starts.
Key features:
- One-step data transfer
- Write operations on the source database are fully stopped
- Writes stay disabled until the migration finishes, for a duration that depends on the database size and network quality
During this time, the source database still responds to read requests. However, if your website or application depends on writing data, it won't work properly until the migration finishes. This method suits services that can pause write operations temporarily.
Online Migration
In online migration, data is moved without stopping the source database's service. After the initial backup is restored, replication is set up between the source and target databases, and new changes are transferred continuously.
Key features:
- No stop to write operations during the migration
- Continuous data synchronization
- Writes on the source database stop at the end of the migration, and you can start writing to the target database as soon as the migration finishes
- Replication lag monitoring
This method is recommended for production services and sensitive workloads.
- Online migration for MySQL is only possible on versions that fully support binlog and GTID.
- Online migration for PostgreSQL requires the source database to support logical replication.
Migration Steps
From the Cloud Database menu, select Migration and click Start Migration.
Step 1: Connect to the Source Database
First, enter the source database's details, including the host, port, username, and password.
After the connection is established, the following are checked:
- The connection details are correct
- The user has the access level required for the migration (Superuser or Root access)
- The source and target database types are compatible
- The source database's current version is supported
- The prerequisites for online or offline migration
If all checks pass, you can choose the migration method (online or offline).
If the connection fails, check the source database's firewall settings and make sure the target database's IP is allowed to access the source database. Also make sure the port you entered in the connection details is open on the source database's firewall.
Step 2: Choose the Migration Method
In this step, choose whether to migrate your data online or offline.
-
Offline Migration
When the migration starts, writes on the source database are disabled and the database is put in read-only mode. As a result, the database only responds to read queries from your website or application.
In MySQL, writes are disabled on both the source and the target database.
-
Online Migration
- Online migration for the MySQL engine is only possible when the following prerequisites are enabled on the source database:
- A unique
server_idis defined - Binary logging is enabled
binlog_formatis set toROWgtid_modeis set toON
- A unique
- Online migration for the PostgreSQL engine is only possible when the following prerequisite is enabled on the source database:
wal_levelis set tological.
- Online migration for the MySQL engine is only possible when the following prerequisites are enabled on the source database:
During the migration, you can see the status of the process. In online migration, the replication lag is also shown, which indicates the synchronization delay between the source and target databases. Whenever the replication lag drops below 60 seconds, you can click Complete Migration. This disables writes on the source database.
In the final step, write operations on the source database stop and the target database becomes the active database. After this step, change your website's or application's connection to the target database (the Arvancloud Cloud Database) so all read and write operations go to it.
Note that in both online and offline migration, once writes on the source database are disabled, they aren't re-enabled automatically. If you want to re-enable writes on the source database after the migration finishes, you have to do it manually. However, this isn't recommended because it risks making the data inconsistent.