Skip to content

Database conversion

Aaron W Morris edited this page Mar 27, 2024 · 9 revisions

General

Use these instructions to convert your Sqlite database to MariaDB/MySQL.

  1. Stop indi-allsky

     systemctl --user stop indi-allsky
    
  2. Activate virtualenv

     source virtualenv/indi-allsky/bin/activate
    
  3. Ensure your database schema is at the latest level

     flask db revision --autogenerate
     flask db upgrade head
    
  4. Create new mysql database

  5. Update SqlAlchemy URL and migration folder in /etc/indi-allsky/flask.json

    • SQLALCHEMY_DATABASE_URI
    • MIGRATION_FOLDER - set to /var/lib/indi-allsky/migrations_mysql
  6. Initialize new migrations

     flask db init
    
  7. Create initial revision

     flask db revision --autogenerate
    
  8. Upgrade revision

     flask db upgrade head
    
  9. Update conversion script with the mysql DST_URL

    • misc/convert_db.py
  10. Run migration script

    • This process can take 3-5 minutes on Raspberry Pi hardware, be patient
  11. Restart indi-allsky

Clone this wiki locally