Skip to content

Update for Ombi Docker Database Migration #176

Description

@browneye253

Describe the error
These are some updated steps to help with migrating the DB when using a docker instance

Location
What page in the docs does the error appear on?

Suggested correction
The current docs describe the multi database migration. The steps would probably be similar but mine focus on moving to a single database.

P: How to migrate to a single database using docker?

#1 Setup your MariaDB first and create your Ombi database and ombi user. You can find help for the Single Database Setup here: https://docs.ombi.app/info/alternate-databases/#create-database-and-user

#2 Install python3 in your ombi docker container. The following command will get you a bash instance inside your ombi docker container.

Run docker exec ombi bash

From the bash prompt install the appropriate python3 tools

apt update; apt install python3 python3-mysqldb -y;

#3 Copy the python scripts to /config or create a migrate folder and mount that volume in your container.
Help for the script here: https://docs.ombi.app/guides/migrating-databases/#1-requirements

In the docker storage config, mount the ombi_sqlite_mysql folder to the container (we recommend mounting it as /migrate).

#4 Create a database.json file by running this command in docker ombi bash:
python3 ombi_sqlite2mysql.py -c /config --only_db_json --host --db Ombi --user --passwd

#5 Restart the docker container. This will create tables in the MariaDB Ombi database and your instance should start with the original setup wizard.

#6 Run this command in docker bash to kickoff your data migration
python3 ombi_sqlite2mysql.py -c /config --host --db Ombi --user --passwd

#7 Restart the container and you should be greeted with a login window. Once you're logged in go to Settings and confirm that the Ombi Database now shows MySQL

Screenshots
If applicable, add screenshots to help explain your problem.

Method of access:

  • OS: Any
  • Docker
  • Browser: [e.g. Chrome, Firefox, Safari, Opera, Edge]

Additional context
Could probably use some clarification on step 3. I personally uploaded all the python migration scripts to my config folder because it was easier than messing with getting an additional volume mounted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions