Comments (5)
Hi,
I'll need a bit more info to help you out here.
You can start by supplying the DDL and some sample data. Additionally you could also try to use the tool without transferring any foreign keys.
from sqlite3-to-mysql.
2024-03-26 16:58:30 ERROR MySQL failed creating table activity: 3780 (HY000): Referencing column 'user_activity_id' and referenced column 'id' in foreign key constraint 'common_app_notification_FK_0_0' are incompatible.
Traceback (most recent call last):
File "/.venv/bin/sqlite3mysql", line 8, in <module>
sys.exit(cli())
^^^^^
File "/.venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/.venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.venv/lib/python3.11/site-packages/sqlite3_to_mysql/cli.py", line 187, in cli
).transfer()
^^^^^^^^^^
File "/.venv/lib/python3.11/site-packages/sqlite3_to_mysql/transporter.py", line 665, in transfer
self._create_table(table["name"], transfer_rowid=transfer_rowid)
File "/.venv/lib/python3.11/site-packages/sqlite3_to_mysql/transporter.py", line 382, in _create_table
self._mysql_cur.execute(sql)
File "/.venv/lib/python3.11/site-packages/mysql/connector/cursor.py", line 1510, in execute
res = self._connection.cmd_stmt_execute(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.venv/lib/python3.11/site-packages/mysql/connector/opentelemetry/context_propagation.py", line 74, in wrapper
return method(cnx, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.venv/lib/python3.11/site-packages/mysql/connector/connection.py", line 1459, in cmd_stmt_execute
result = self._handle_binary_result(packet)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.venv/lib/python3.11/site-packages/mysql/connector/connection.py", line 1349, in _handle_binary_result
raise get_exception(packet)
mysql.connector.errors.DatabaseError: 3780 (HY000): Referencing column 'user_activity_id' and referenced column 'id' in foreign key constraint 'common_app_notification_FK_0_0' are incompatible.
Pushed command:
sqlite3mysql -f ./db.sqlite3 -d sqlite_to_mysql -u newuser --mysql-password password -h 127.0.0.1 -P 3306 --debug
Without transferring foreign key is not a solution. I want to data migrate as it is without any change into the data.
from sqlite3-to-mysql.
Without transferring foreign key is not a solution. I want to data migrate as it is without any change into the data.
I don't see why. It won't change the data.
Your problem is clearly with your DDL, as the foreign keys are incompatible for MySQL while they are fine in SQLite (which is not surprising tbh), so please supply that and we can inspect this into further detail.
from sqlite3-to-mysql.
Can you please explain me bit more about Without transferring foreign key
. How it's work and how my problem will solve within this?
Also, I tried to understand the problem but, i can't. Can you elaborate the problem in detail.
from sqlite3-to-mysql.
Can you please explain me bit more about Without transferring foreign key.
As the manual / help text says, you use the tool with this switch
-X, --without-foreign-keys Do not transfer foreign keys.
How it's work and how my problem will solve within this?
You'll then have to use some DBA tool, like say DBeaver, and update your foreign keys in your MySQL database manually.
from sqlite3-to-mysql.
Related Issues (20)
- Tried migration using Docker container but didn't work HOT 14
- Request to Add sqlite3mysql example command similar to running from docker
- Data Migration with incorrect values when values are out of data range instead of an error. HOT 8
- Support for Data migration alone HOT 7
- Tool is messing with schema in auto increment HOT 1
- After migration and post-migration HOT 1
- After migration and post-migration HOT 4
- sqlite3mysql: command not found ubuntu 22.04 installation or usage issue HOT 1
- Export to sql file for mysql HOT 1
- Skip errors HOT 3
- sqlite3mysql is not defined HOT 4
- sqlite3-to-mysql privat problem HOT 3
- Default host: 172.22.0.1 HOT 2
- 1427 (42000) error when Transferring table HOT 8
- Incomprehensible error message: invalid column type HOT 4
- Statically Binary missing HOT 3
- ModuleNotFoundError: No module named 'packaging' HOT 1
- Unsupported data type INTEGER UNSIGNED HOT 4
- I would like to be able to migrate the number of digits in numeric columns as well. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlite3-to-mysql.