Kallithea sqlite database to mysql database

554 views Asked by At

I've Kallithea running on my own server with sqlite database. I would like to move all this data to MySQL database instead. On default Kallithea uses sqlite if not any other database is specified. From Kallithea documentation pdf https://media.readthedocs.org/pdf/kallithea/latest/kallithea.pdf they recommend to use https://github.com/shazow/sqlalchemygrate to migrate data from database to another.

I'm installed sqlalchemygrate using Python pip but when I try to migrate there is parts what I don't understand at all. Help menu doesn't not clearly specify how to use migrate command. At least I don't understand it at all. For example when I try to type

grate migrate "sqlite:./kallithea.db" "mysql://kallithea@localhost/kallithea"

I get error saying

ImportError: No module named sqlite

In help menu it says to use

migrate METADATA ENGINE_FROM ENGINE_TO Migrate schema or data from one engine to another.

And example how to use it

grate migrate model.meta:metadata \ "mysql://foo:bar@localhost/baz" "sqlite:///:memory:" \

What I don't really understand is what is that metadata it needs? And how to specify sqlite .db file for this. And how to migrate data to new kallithea database in mysql with user kallithea which has all privileges to that database.

2

There are 2 answers

0
shazow On

ImportError: No module named sqlite

You probably need to install sqlite, and pip install sqlite or similar.

Regarding what metadata it needs, it's referring to metadata in the context of SQLAlchemy: http://docs.sqlalchemy.org/en/latest/core/metadata.html

0
marcinkuzminski On

Not sure about Kallithea but RhodeCode users had a great success using TAPS (https://github.com/ricardochimal/taps) project to migrate they databases to different format.