Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Ombi Docker Database Migration #176

Open
browneye253 opened this issue Dec 10, 2021 · 1 comment
Open

Update for Ombi Docker Database Migration #176

browneye253 opened this issue Dec 10, 2021 · 1 comment

Comments

@browneye253
Copy link

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.

@JuniperMS
Copy link

You may want to mention in number two that you'll need to install git within the ombi docker container.

apt-get update
apt install git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants