dragotin / kraft

Kraft helps to handle your daily quotes and invoices in your small business.
http://volle-kraft-voraus.de
GNU General Public License v2.0
56 stars 18 forks source link

Feature Request: Coversion of sqlite database to mysql/mariadb #150

Closed noseshimself closed 2 years ago

noseshimself commented 2 years ago

With using several computers depending on location and purpose becoming the norm, people will want to move from sqlite to a database server.

The easiest method (dump the sqlite3 database and read the dump into mysql does not work due to slight differences in the data definition languages. But there is a way around.

1) Dump the database: sqlite 3 kraft.db .dump > database-dump.sqlite 2) Install sqlite3-to-mysql (https://pypi.org/project/sqlite3-to-mysql/) to convert the database or if you don't care who is getting access your data, use https://www.rebasedata.com/convert-sqlite-to-mysql-online to convert it. 3) Create the mysql user according to Kraft's requirements and read the converted dump mysql -u kraft -p kraftdb < database-dump.mysql 4) Modify .config/kraftdatabaserc

Sounds easy enough (and should work in the other direction, too).

Would it be possible to add a short script to the Kraft distribution to help converting a database and (bonus question) adjust the kraftdatabaserc?

dragotin commented 2 years ago

I tried this and that did not result in useable migrations (sqlite to mysql) - with very tricky error symptoms.

I will not follow up on this.

noseshimself commented 2 years ago

I tried several more converters and none of them had acceptable results.