×
Community Blog Data Migration from SQLite to PolarDB for MySQL

Data Migration from SQLite to PolarDB for MySQL

This article provides a step-by-step guide on how to use the Navicat Premium tool to migrate data from an SQLite database to PolarDB for MySQL.

For how to migrate data from an SQLite database to PolarDB for MySQL, we recommend you use the Navicat Premium tool.

Official website link of Navicat Premium: https://www.navicat.com/en/

1. Export SQLite Files

1.1 View the database file that SQLite needs to export.

.database 

1

1.2 Locate the file in the system and download it to the local computer.

2

1.3 Use Navicat Premium to create an SQLite connection and import the .db file.

3
4

1.4 View the connected SQLite database and table file data.

5

1.5 Export the table in the SQLite database as a CSV file.
-----> Do not export directly as an SQL file here.

6
7

For the exported CSV file, you can do some custom restrictions, as follows (you can directly use the default settings).

8
9
10

2. Import Data to PolarDB for MySQL

2.1 Purchase a PolarDB for MySQL cluster instance.

2.2 Create a PolarDB connection account.

11

2.3 Enable the IP address whitelist for the cluster.

12

2.4 Enable the public endpoint.

13

2.5 Use Navicat to connect to PolarDB for MySQL.

14
15

2.6 Create an SQLite to import the database.

16
17

Select the CSV file to import.

18

2.7 Select the CSV file exported by SQLite and import it into the database created by MySQL.

19
20
21

The settings here should be the same as those when you export the CSV file.

22

Here, the field length and primary key need to be modified according to the actual content.

23
24
25

2.8 View the imported table data.

26

The above are the steps to import data from SQLite to PolarDB for MySQL.

3. Check Data Consistency

3.1 View the original SQLite database table and the count of data rows.

27
28
29

3.2 Check the exported CSV file to see whether the data and file encoding are normal.

30
31

3.3 Check the database table and the count of rows imported into PolarDB for MySQL.

32
33

0 1 0
Share on

ApsaraDB

562 posts | 178 followers

You may also like

Comments

ApsaraDB

562 posts | 178 followers

Related Products