vsc55 / ombi_sqlite_mysql

Migration tool from SQLite to MySql/MariaDB for ombi
GNU General Public License v3.0
3 stars 9 forks source link

Mirgation error #17

Closed bonkersGER closed 2 years ago

bonkersGER commented 3 years ago

I got the following error

/etc/Ombi/ombi_sqlite_mysql# python3 ombi_sqlite2mysql.py -c /etc/Ombi --host 127.0.0.1 --db Ombi --user ombi--passwd ombi

Migration tool from SQLite to MySql/MariaDB for ombi (3.0.4) By VSC55

Generate file "database.json":
- Saving in (/etc/Ombi/database.json)... [✓]

MySQL > Connecting... [✓]
- Reading   [............................................................] 0/1
- Error: Table "{0}" requiered is not exist in the server MySQL!!!
Traceback (most recent call last):
  File "ombi_sqlite2mysql.py", line 1150, in <module>
    main()
  File "ombi_sqlite2mysql.py", line 1111, in main
    if not _fix_insert_read_mysql():
  File "ombi_sqlite2mysql.py", line 932, in _fix_insert_read_mysql
    print("- Error: Table \"{0}\" requiered is not exist in the server MySQL!!!").format(k)
AttributeError: 'NoneType' object has no attribute 'format'

Server-Version: 10.5.11-MariaDB-1:10.5.11+maria~focal - mariadb.org binary distribution

phpmyadmin

vsc55 commented 3 years ago

Hi @bonkersGER

You can check if "/etc/Ombi/migration.json" exists and if it contains something like this:

{
    "OmbiDatabase": {
        "Type": "sqlite",
        "ConnectionString": "Data Source=/etc/Ombi/Ombi.db"
    },
    "SettingsDatabase": {
        "Type": "sqlite",
        "ConnectionString": "Data Source=/etc/Ombi/OmbiSettings.db"
    },
    "ExternalDatabase": {
        "Type": "sqlite",
        "ConnectionString": "Data Source=/etc/Ombi/OmbiExternal.db"
    }
}

You can also check that the following files exist:

/etc/Ombi/Ombi.db
/etc/Ombi/OmbiSettings.db
/etc/Ombi/OmbiExternal.db
vsc55 commented 3 years ago

Hi @bonkersGER

I have noticed that in the command you did not put a space between the username and the --password argument.

python3 ombi_sqlite2mysql.py -c /etc/Ombi --host 127.0.0.1 --db Ombi --user ombi--passwd ombi

I also see that it has 4 databases, how much you have to have 1 or 3 databases. I will have to update the guide as it seems to me that it leads to confusion.

There are 2 options. Option 1: All the tables in the same database. Option 2: Separate the tables into different databases, just like ombi does with sqlite databases.

What option are you interested in?

If you want a single database, follow the guide in this order:

rabidwoodlouse commented 2 years ago

Hello ! Same issue for me. OS: Debian 11 mariadb Ver 15.1 Distrib 10.5.12-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper Ombi on Docker container

root@fe2992d99087:/# python3 /migrate/ombi_sqlite2mysql_multi.py -c /config Migration tool from SQLite to Multi MySql/MariaDB for ombi (1.0.0) By VSC55

  • Processing DataBase (OmbiDatabase)...

  • Saving in (/config/migration.json)... [✓] Generate file "database.json":

  • Saving in (/config/database.json)... [✓]

MySQL > Connecting... [✓]

  • Reading [............................................................] 0/1
  • Error: Table "{0}" requiered is not exist in the server MySQL!!! Traceback (most recent call last): File "/migrate/ombi_sqlite2mysql_multi.py", line 312, in main() File "/migrate/ombi_sqlite2mysql_multi.py", line 276, in main ombi_sqlite2mysql.main() File "/migrate/ombi_sqlite2mysql.py", line 1111, in main if not _fix_insert_read_mysql(): File "/migrate/ombi_sqlite2mysql.py", line 932, in _fix_insert_read_mysql print("- Error: Table \"{0}\" requiered is not exist in the server MySQL!!!").format(k) AttributeError: 'NoneType' object has no attribute 'format'
vsc55 commented 2 years ago

Hi @rabidwoodlouse, Could you try the latest update to see if the error no longer occurs? Thanks

rabidwoodlouse commented 2 years ago

OK, I can test again! Thank you for you new commit patch.

Le sam. 18 déc. 2021 à 11:46, Javier Pastor @.***> a écrit :

Hi @rabidwoodlouse https://github.com/rabidwoodlouse, Could you try the latest update to see if the error no longer occurs? Thanks

— Reply to this email directly, view it on GitHub https://github.com/vsc55/ombi_sqlite_mysql/issues/17#issuecomment-997184181, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGXJ2H5QXWOEAJTHN5EVGALURRRBBANCNFSM47JFYTKQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

rabidwoodlouse commented 2 years ago
root@6f233a65a9bc:~# python3 /migrate/ombi_sqlite2mysql_multi.py -c /config
Migration tool from SQLite to Multi MySql/MariaDB for ombi (1.0.0) By VSC55

- Processing DataBase (OmbiDatabase)...
  -------------------

- Saving in (/config/migration.json)... [✓]
Generate file "database.json":
- Saving in (/config/database.json)... [✓]

MySQL > Connecting... [✓]
- Reading   [............................................................] 0/1
- Error: Table "__efmigrationshistory" requiered is not exist in the server MySQL!!!
Read tables [!!]

MySQL > Disconnecting... [✓]

----------------------------------------------------------------
----------------------------------------------------------------

- Processing DataBase (SettingsDatabase)...
  -------------------

- Saving in (/config/migration.json)... [✓]
Generate file "database.json":
- Saving in (/config/database.json)... [✓]

MySQL > Connecting... [✓]
- Reading   [............................................................] 0/1
- Error: Table "__efmigrationshistory" requiered is not exist in the server MySQL!!!
Read tables [!!]

MySQL > Disconnecting... [✓]

----------------------------------------------------------------
----------------------------------------------------------------

- Processing DataBase (ExternalDatabase)...
  -------------------

- Saving in (/config/migration.json)... [✓]
Generate file "database.json":
- Saving in (/config/database.json)... [✓]

MySQL > Connecting... [✓]
- Reading   [............................................................] 0/1
- Error: Table "__efmigrationshistory" requiered is not exist in the server MySQL!!!
Read tables [!!]

MySQL > Disconnecting... [✓]

----------------------------------------------------------------
----------------------------------------------------------------

> Updating database.json...
- Saving in (/config/database.json)... [✓]
rabidwoodlouse commented 2 years ago
09:43:21 root@Batcave:~/.config/Ombi# ls
custom-cont-init.d  custom-services.d  database.json  database_multi.json  Logs  migration.json  Ombi.db  OmbiExternal.db  OmbiSettings.db
09:43:22 root@Batcave:~/.config/Ombi# systemctl restart ombi.service
09:43:31 root@Batcave:~/.config/Ombi# ls
custom-cont-init.d  custom-services.d  database.json  database_multi.json  Logs  migration.json  Ombi.db  OmbiExternal.db  OmbiSettings.db
09:43:35 root@Batcave:~/.config/Ombi# systemctl status ombi.service
● ombi.service - Ombi Service Docker
     Loaded: loaded (/etc/systemd/system/ombi.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2021-12-20 09:43:31 CET; 9s ago
    Process: 994032 ExecStartPre=/usr/bin/docker kill ${NAME} (code=exited, status=1/FAILURE)
    Process: 994043 ExecStartPre=/usr/bin/docker rm ${NAME} (code=exited, status=0/SUCCESS)
   Main PID: 994054 (docker)
      Tasks: 14 (limit: 38082)
     Memory: 28.0M
        CPU: 113ms
     CGroup: /system.slice/ombi.service
             └─994054 /usr/bin/docker run --name ombi -e PUID=1001 -e PGID=1001 -p 5000:3579 -v /root/.config/Ombi:/config -v /root/ombi_sqlite_mysql:/migrate -v /var/run/mysqld:/var/run/mysqld linuxserver/ombi:development

Dec 20 09:43:40 Batcave docker[994054]:                http://localhost:5000). The protocol (http:// or https://) must
Dec 20 09:43:40 Batcave docker[994054]:                be included with each URL. Supported formats vary between
Dec 20 09:43:40 Batcave docker[994054]:                servers.
Dec 20 09:43:40 Batcave docker[994054]:   --storage    Storage path, where we save the logs and database
Dec 20 09:43:40 Batcave docker[994054]:   --baseurl    The base URL for reverse proxy scenarios
Dec 20 09:43:40 Batcave docker[994054]:   --demo       Demo mode, you will never need to use this, fuck that fruit
Dec 20 09:43:40 Batcave docker[994054]:                company...
Dec 20 09:43:40 Batcave docker[994054]:   --migrate    Will run the migrations then exit the application
Dec 20 09:43:40 Batcave docker[994054]:   --help       Display this help screen.
Dec 20 09:43:40 Batcave docker[994054]:   --version    Display version information.
Dec 20 09:43:41 Batcave docker[994054]: Unhandled exception. MySqlConnector.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
Dec 20 09:43:41 Batcave docker[994054]:    at MySqlConnector.Core.ServerSession.ConnectAsync(ConnectionSettings cs, MySqlConnection connection, Int32 startTickCount, ILoadBalancer loadBalancer, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ServerSession.cs:line 432
Dec 20 09:43:41 Batcave docker[994054]:    at MySqlConnector.Core.ConnectionPool.ConnectSessionAsync(MySqlConnection connection, String logMessage, Int32 startTickCount, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ConnectionPool.cs:line 363
Dec 20 09:43:41 Batcave docker[994054]:    at MySqlConnector.Core.ConnectionPool.GetSessionAsync(MySqlConnection connection, Int32 startTickCount, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ConnectionPool.cs:line 94
Dec 20 09:43:41 Batcave docker[994054]:    at MySqlConnector.Core.ConnectionPool.GetSessionAsync(MySqlConnection connection, Int32 startTickCount, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ConnectionPool.cs:line 124
Dec 20 09:43:41 Batcave docker[994054]:    at MySqlConnector.MySqlConnection.CreateSessionAsync(ConnectionPool pool, Int32 startTickCount, Nullable`1 ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlConnection.cs:line 911
Dec 20 09:43:41 Batcave docker[994054]:    at MySqlConnector.MySqlConnection.OpenAsync(Nullable`1 ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlConnection.cs:line 405
Dec 20 09:43:41 Batcave docker[994054]:    at MySqlConnector.MySqlConnection.Open() in /_/src/MySqlConnector/MySqlConnection.cs:line 369
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.EntityFrameworkCore.ServerVersion.AutoDetect(String connectionString)
Dec 20 09:43:41 Batcave docker[994054]:    at Ombi.Extensions.DatabaseExtensions.ConfigureMySql(DbContextOptionsBuilder options, PerDatabaseConfiguration config) in /home/runner/work/Ombi/Ombi/src/Ombi/Extensions/DatabaseExtensions.cs:line 123
Dec 20 09:43:41 Batcave docker[994054]:    at Ombi.Extensions.DatabaseExtensions.<>c__DisplayClass2_0.<ConfigureDatabases>b__5(DbContextOptionsBuilder x) in /home/runner/work/Ombi/Ombi/src/Ombi/Extensions/DatabaseExtensions.cs:line 57
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.<>c__DisplayClass1_0`2.<AddDbContext>b__0(IServiceProvider p, DbContextOptionsBuilder b)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.CreateDbContextOptions[TContext](IServiceProvider applicationServiceProvider, Action`2 optionsAction)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.<>c__DisplayClass17_0`1.<AddCoreServices>b__0(IServiceProvider p)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
Dec 20 09:43:41 Batcave docker[994054]:    at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
Dec 20 09:43:41 Batcave docker[994054]:    at Ombi.Program.Main(String[] args) in /home/runner/work/Ombi/Ombi/src/Ombi/Program.cs:line 74
Dec 20 09:43:41 Batcave docker[994054]:    at Ombi.Program.<Main>(String[] args)
rabidwoodlouse commented 2 years ago

I have test connection database ombi with mariadb-client on my Ombi container and it's OK

root@e9081fee0d6a:/opt/ombi# mysql -h localhost -u ombi -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 37
Server version: 10.5.12-MariaDB-0+deb11u1 Debian 11

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| Ombi               |
| information_schema |
+--------------------+
2 rows in set (0.00 sec)

MariaDB [(none)]> use Ombi;
Database changed
MariaDB [Ombi]> show tables;
Empty set (0.00 sec)

MariaDB [Ombi]>
rabidwoodlouse commented 2 years ago

but when i have this file in ombi configuration folder (database.json), ombi don't start

Unhandled exception. MySqlConnector.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.

I have update mariadb version. Server version: 10.5.12-MariaDB-0+deb11u1 Debian 11 to mariadb Ver 15.1 Distrib 10.6.5-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Same errors :(

vsc55 commented 2 years ago

Hi @rabidwoodlouse , So it appears that the necessary tables have not been created in the database. Have you run ombi --migrate?

# python ombi_sqlite2mysql.py -c /config --only_db_json --host 127.0.0.1 --db Ombi --user ombi --passwd ombi
# ombi --migrate
# python ombi_sqlite2mysql.py -c /config --host 127.0.0.1 --db Ombi --user ombi --passwd ombi

Change /config to the location where you have the ombi sqlite databases.

Update: I see that you are doing it within a Docker, I have not tested it, so I can not tell you that it works correctly.

Update2: You are using ombi_sqlite2mysql_multi.py wrongly, this script is to use multiple databases or servers. To use a single database you have to use python ombi_sqlite2mysql.py.

rabidwoodlouse commented 2 years ago

Hello @vsc55,

First test:

custom-cont-init.d  custom-services.d  database_multi.json  Logs  migration.json  Ombi.db  OmbiExternal.db  OmbiSettings.db
08:45:47 root@Batcave:~/.config/Ombi# cat database_multi.json
{"OmbiDatabase": {"Type": "MySQL", "ConnectionString": "Server=localhost;Port=3306;Database=Ombi;User=ombi;Password=ombi"}, "SettingsDatabase": {"Type": "MySQL", "ConnectionString": "Server=localhost;Port=3306;Database=Ombi;User=ombi;Password=ombi"}, "ExternalDatabase": {"Type": "MySQL", "ConnectionString": "Server=localhost;Port=3306;Database=Ombi;User=ombi;Password=ombi"}}
08:46:03 root@Batcave:~/.config/Ombi# mv database_multi.json database.json
08:46:21 root@Batcave:~/.config/Ombi# docker exec -it ombi /opt/ombi/Ombi --migrate
Hello, welcome to Ombi
Valid options are:
Ombi 4.7.11
Copyright (C) 2021 Ombi

  --host       (Default: http://*:5000) Set to a semicolon-separated (;) list of
               URL prefixes to which the server should respond. For example,
               http://localhost:123. Use "localhost" to indicate that the server
               should listen for requests on any IP address or hostname using
               the specified port and protocol (for example,
               http://localhost:5000). The protocol (http:// or https://) must
               be included with each URL. Supported formats vary between
               servers.

  --storage    Storage path, where we save the logs and database

  --baseurl    The base URL for reverse proxy scenarios

  --demo       Demo mode, you will never need to use this, fuck that fruit
               company...

  --migrate    Will run the migrations then exit the application

  --help       Display this help screen.

  --version    Display version information.

Migrate in progress...
Migrate complete.

Can't show the tables in my Ombi database:

08:47:12 root@Batcave:~/.config/Ombi# mysql -u ombi -h localhost -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 67
Server version: 10.6.5-MariaDB-1:10.6.5+maria~buster mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| Ombi               |
| information_schema |
+--------------------+
2 rows in set (0.001 sec)

MariaDB [(none)]> use Ombi;
Database changed
MariaDB [Ombi]> show tables;
Empty set (0.000 sec)

MariaDB [Ombi]> exit
Bye

Execute commands migration in docker container:

08:47:59 root@Batcave:~/.config/Ombi# docker exec -it ombi /bin/bash
root@e1d8067f0f4d:/# apt update; apt install python3 python3-mysqldb -y;
Get:1 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic/multiverse Sources [216 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic/main Sources [1,063 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic/universe Sources [11.5 MB]
Get:7 http://archive.ubuntu.com/ubuntu bionic/restricted Sources [5,823 B]
Get:8 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1,344 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]
Get:10 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/main Sources [651 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/universe Sources [596 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse Sources [18.1 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/restricted Sources [29.1 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [2,230 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2,898 kB]
Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [725 kB]
Get:19 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [34.4 kB]
Get:20 http://archive.ubuntu.com/ubuntu bionic-security/multiverse Sources [8,784 B]
Get:21 http://archive.ubuntu.com/ubuntu bionic-security/universe Sources [363 kB]
Get:22 http://archive.ubuntu.com/ubuntu bionic-security/main Sources [326 kB]
Get:23 http://archive.ubuntu.com/ubuntu bionic-security/restricted Sources [25.6 kB]
Get:24 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages [2,461 kB]
Get:25 http://archive.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [691 kB]
Get:26 http://archive.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [26.8 kB]
Get:27 http://archive.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1,452 kB]
Fetched 38.6 MB in 3s (13.0 MB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  file libexpat1 libmagic-mgc libmagic1 libmpdec2 libmysqlclient20 libpython3-stdlib libpython3.6-minimal libpython3.6-stdlib libreadline7 mime-support mysql-common python3-minimal python3.6 python3.6-minimal readline-common xz-utils
Suggested packages:
  python3-doc python3-tk python3-venv default-mysql-server | virtual-mysql-server python-egenix-mxdatetime python3-mysqldb-dbg python3.6-venv python3.6-doc binutils binfmt-support readline-doc
The following NEW packages will be installed:
  file libexpat1 libmagic-mgc libmagic1 libmpdec2 libmysqlclient20 libpython3-stdlib libpython3.6-minimal libpython3.6-stdlib libreadline7 mime-support mysql-common python3 python3-minimal python3-mysqldb python3.6 python3.6-minimal readline-common xz-utils
0 upgraded, 19 newly installed, 0 to remove and 1 not upgraded.
Need to get 5,607 kB of archives.
After this operation, 33.0 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3.6-minimal amd64 3.6.9-1~18.04ubuntu1.6 [534 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libexpat1 amd64 2.2.5-3ubuntu0.2 [80.5 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3.6-minimal amd64 3.6.9-1~18.04ubuntu1.6 [1,609 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3-minimal amd64 3.6.7-1~18.04 [23.7 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic/main amd64 mime-support all 3.60ubuntu1 [30.1 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic/main amd64 libmpdec2 amd64 2.4.2-1ubuntu1 [84.1 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic/main amd64 readline-common all 7.0-3 [52.9 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic/main amd64 libreadline7 amd64 7.0-3 [124 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3.6-stdlib amd64 3.6.9-1~18.04ubuntu1.6 [1,712 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3.6 amd64 3.6.9-1~18.04ubuntu1.6 [203 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3-stdlib amd64 3.6.7-1~18.04 [7,240 B]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3 amd64 3.6.7-1~18.04 [47.2 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libmagic-mgc amd64 1:5.32-2ubuntu0.4 [184 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libmagic1 amd64 1:5.32-2ubuntu0.4 [68.6 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 file amd64 1:5.32-2ubuntu0.4 [22.1 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic/main amd64 xz-utils amd64 5.2.2-1.3 [83.8 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic/main amd64 mysql-common all 5.8+1.0.4 [7,308 B]
Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libmysqlclient20 amd64 5.7.36-0ubuntu0.18.04.1 [689 kB]
Get:19 http://archive.ubuntu.com/ubuntu bionic/main amd64 python3-mysqldb amd64 1.3.10-1build1 [46.0 kB]
Fetched 5,607 kB in 0s (34.4 MB/s)
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76, <> line 19.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7, <> line 19.)
debconf: falling back to frontend: Teletype
Selecting previously unselected package libpython3.6-minimal:amd64.
(Reading database ... 7318 files and directories currently installed.)
Preparing to unpack .../libpython3.6-minimal_3.6.9-1~18.04ubuntu1.6_amd64.deb ...
Unpacking libpython3.6-minimal:amd64 (3.6.9-1~18.04ubuntu1.6) ...
Selecting previously unselected package libexpat1:amd64.
Preparing to unpack .../libexpat1_2.2.5-3ubuntu0.2_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.5-3ubuntu0.2) ...
Selecting previously unselected package python3.6-minimal.
Preparing to unpack .../python3.6-minimal_3.6.9-1~18.04ubuntu1.6_amd64.deb ...
Unpacking python3.6-minimal (3.6.9-1~18.04ubuntu1.6) ...
Setting up libpython3.6-minimal:amd64 (3.6.9-1~18.04ubuntu1.6) ...
Setting up libexpat1:amd64 (2.2.5-3ubuntu0.2) ...
Setting up python3.6-minimal (3.6.9-1~18.04ubuntu1.6) ...
Selecting previously unselected package python3-minimal.
(Reading database ... 7565 files and directories currently installed.)
Preparing to unpack .../0-python3-minimal_3.6.7-1~18.04_amd64.deb ...
Unpacking python3-minimal (3.6.7-1~18.04) ...
Selecting previously unselected package mime-support.
Preparing to unpack .../1-mime-support_3.60ubuntu1_all.deb ...
Unpacking mime-support (3.60ubuntu1) ...
Selecting previously unselected package libmpdec2:amd64.
Preparing to unpack .../2-libmpdec2_2.4.2-1ubuntu1_amd64.deb ...
Unpacking libmpdec2:amd64 (2.4.2-1ubuntu1) ...
Selecting previously unselected package readline-common.
Preparing to unpack .../3-readline-common_7.0-3_all.deb ...
Unpacking readline-common (7.0-3) ...
Selecting previously unselected package libreadline7:amd64.
Preparing to unpack .../4-libreadline7_7.0-3_amd64.deb ...
Unpacking libreadline7:amd64 (7.0-3) ...
Selecting previously unselected package libpython3.6-stdlib:amd64.
Preparing to unpack .../5-libpython3.6-stdlib_3.6.9-1~18.04ubuntu1.6_amd64.deb ...
Unpacking libpython3.6-stdlib:amd64 (3.6.9-1~18.04ubuntu1.6) ...
Selecting previously unselected package python3.6.
Preparing to unpack .../6-python3.6_3.6.9-1~18.04ubuntu1.6_amd64.deb ...
Unpacking python3.6 (3.6.9-1~18.04ubuntu1.6) ...
Selecting previously unselected package libpython3-stdlib:amd64.
Preparing to unpack .../7-libpython3-stdlib_3.6.7-1~18.04_amd64.deb ...
Unpacking libpython3-stdlib:amd64 (3.6.7-1~18.04) ...
Setting up python3-minimal (3.6.7-1~18.04) ...
Selecting previously unselected package python3.
(Reading database ... 8017 files and directories currently installed.)
Preparing to unpack .../0-python3_3.6.7-1~18.04_amd64.deb ...
Unpacking python3 (3.6.7-1~18.04) ...
Selecting previously unselected package libmagic-mgc.
Preparing to unpack .../1-libmagic-mgc_1%3a5.32-2ubuntu0.4_amd64.deb ...
Unpacking libmagic-mgc (1:5.32-2ubuntu0.4) ...
Selecting previously unselected package libmagic1:amd64.
Preparing to unpack .../2-libmagic1_1%3a5.32-2ubuntu0.4_amd64.deb ...
Unpacking libmagic1:amd64 (1:5.32-2ubuntu0.4) ...
Selecting previously unselected package file.
Preparing to unpack .../3-file_1%3a5.32-2ubuntu0.4_amd64.deb ...
Unpacking file (1:5.32-2ubuntu0.4) ...
Selecting previously unselected package xz-utils.
Preparing to unpack .../4-xz-utils_5.2.2-1.3_amd64.deb ...
Unpacking xz-utils (5.2.2-1.3) ...
Selecting previously unselected package mysql-common.
Preparing to unpack .../5-mysql-common_5.8+1.0.4_all.deb ...
Unpacking mysql-common (5.8+1.0.4) ...
Selecting previously unselected package libmysqlclient20:amd64.
Preparing to unpack .../6-libmysqlclient20_5.7.36-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libmysqlclient20:amd64 (5.7.36-0ubuntu0.18.04.1) ...
Selecting previously unselected package python3-mysqldb.
Preparing to unpack .../7-python3-mysqldb_1.3.10-1build1_amd64.deb ...
Unpacking python3-mysqldb (1.3.10-1build1) ...
Setting up readline-common (7.0-3) ...
Setting up mime-support (3.60ubuntu1) ...
Setting up libreadline7:amd64 (7.0-3) ...
Setting up mysql-common (5.8+1.0.4) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Setting up libmagic-mgc (1:5.32-2ubuntu0.4) ...
Setting up libmagic1:amd64 (1:5.32-2ubuntu0.4) ...
Setting up xz-utils (5.2.2-1.3) ...
update-alternatives: using /usr/bin/xz to provide /usr/bin/lzma (lzma) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/lzma.1.gz because associated file /usr/share/man/man1/xz.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/unlzma.1.gz because associated file /usr/share/man/man1/unxz.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzcat.1.gz because associated file /usr/share/man/man1/xzcat.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzmore.1.gz because associated file /usr/share/man/man1/xzmore.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzless.1.gz because associated file /usr/share/man/man1/xzless.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzdiff.1.gz because associated file /usr/share/man/man1/xzdiff.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzcmp.1.gz because associated file /usr/share/man/man1/xzcmp.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzgrep.1.gz because associated file /usr/share/man/man1/xzgrep.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzegrep.1.gz because associated file /usr/share/man/man1/xzegrep.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzfgrep.1.gz because associated file /usr/share/man/man1/xzfgrep.1.gz (of link group lzma) doesn't exist
Setting up libmysqlclient20:amd64 (5.7.36-0ubuntu0.18.04.1) ...
Setting up libmpdec2:amd64 (2.4.2-1ubuntu1) ...
Setting up libpython3.6-stdlib:amd64 (3.6.9-1~18.04ubuntu1.6) ...
Setting up python3.6 (3.6.9-1~18.04ubuntu1.6) ...
Setting up file (1:5.32-2ubuntu0.4) ...
Setting up libpython3-stdlib:amd64 (3.6.7-1~18.04) ...
Setting up python3 (3.6.7-1~18.04) ...
running python rtupdate hooks for python3.6...
running python post-rtupdate hooks for python3.6...
Setting up python3-mysqldb (1.3.10-1build1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...

root@e1d8067f0f4d:/# python3 /migrate/ombi_sqlite2mysql.py -c /config
Migration tool from SQLite to MySql/MariaDB for ombi (3.0.5) By VSC55

Traceback (most recent call last):
  File "/migrate/ombi_sqlite2mysql.py", line 1153, in <module>
    main()
  File "/migrate/ombi_sqlite2mysql.py", line 1109, in main
    _mysql_database_json_update(True)
  File "/migrate/ombi_sqlite2mysql.py", line 1006, in _mysql_database_json_update
    "ConnectionString": "Server={0};Port={1};Database={2};User={3};Password={4}".format(mysql_cfg['host'], mysql_cfg['port'], mysql_cfg['db'], mysql_cfg['user'], mysql_cfg['passwd'])
TypeError: 'NoneType' object is not subscriptable

Others tests in docker container

08:52:44 root@Batcave:~/.config/Ombi# python ombi_sqlite2mysql.py -c /config --only_db_json --host 127.0.0.1 --db Ombi --user ombi --passwd ombi^C
08:52:47 root@Batcave:~/.config/Ombi# docker exec -it ombi /bin/bash
root@e1d8067f0f4d:/# cd /migrate
root@e1d8067f0f4d:/migrate# python3 ombi_sqlite2mysql.py -c /config --only_db_json --host 127.0.0.1 --db Ombi --user ombi --passwd ombi
Migration tool from SQLite to MySql/MariaDB for ombi (3.0.5) By VSC55

Generate file "database.json":
- Saving in (/config/database.json)... [✓]

root@e1d8067f0f4d:/migrate# /opt/ombi/Ombi --migrate
Hello, welcome to Ombi
Valid options are:
Ombi 4.7.11
Copyright (C) 2021 Ombi

  --host       (Default: http://*:5000) Set to a semicolon-separated (;) list of
               URL prefixes to which the server should respond. For example,
               http://localhost:123. Use "localhost" to indicate that the server
               should listen for requests on any IP address or hostname using
               the specified port and protocol (for example,
               http://localhost:5000). The protocol (http:// or https://) must
               be included with each URL. Supported formats vary between
               servers.

  --storage    Storage path, where we save the logs and database

  --baseurl    The base URL for reverse proxy scenarios

  --demo       Demo mode, you will never need to use this, fuck that fruit
               company...

  --migrate    Will run the migrations then exit the application

  --help       Display this help screen.

  --version    Display version information.

Migrate in progress...
Migrate complete.
root@e1d8067f0f4d:/migrate# python3 ombi_sqlite2mysql.py -c /config --host 127.0.0.1 --db Ombi --user ombi --passwd ombi
Migration tool from SQLite to MySql/MariaDB for ombi (3.0.5) By VSC55

Generate file "database.json":
- Saving in (/config/database.json)... [✓]

MySQL > Connecting... [!!]
* MySQL Error [2003]: Can't connect to MySQL server on '127.0.0.1' (111)
root@e1d8067f0f4d:/migrate# python3 ombi_sqlite2mysql.py -c /config --only_db_json --host localhost --db Ombi --user ombi --passwd ombi
Migration tool from SQLite to MySql/MariaDB for ombi (3.0.5) By VSC55

Generate file "database.json":
- Saving in (/config/database.json)... [✓]

root@e1d8067f0f4d:/migrate# /opt/ombi/Ombi --migrate
Hello, welcome to Ombi
Valid options are:
Ombi 4.7.11
Copyright (C) 2021 Ombi

  --host       (Default: http://*:5000) Set to a semicolon-separated (;) list of
               URL prefixes to which the server should respond. For example,
               http://localhost:123. Use "localhost" to indicate that the server
               should listen for requests on any IP address or hostname using
               the specified port and protocol (for example,
               http://localhost:5000). The protocol (http:// or https://) must
               be included with each URL. Supported formats vary between
               servers.

  --storage    Storage path, where we save the logs and database

  --baseurl    The base URL for reverse proxy scenarios

  --demo       Demo mode, you will never need to use this, fuck that fruit
               company...

  --migrate    Will run the migrations then exit the application

  --help       Display this help screen.

  --version    Display version information.

Migrate in progress...
Migrate complete.
root@e1d8067f0f4d:/migrate# python3 ombi_sqlite2mysql.py -c /config --host localhost --db Ombi --user ombi --passwd ombi
Migration tool from SQLite to MySql/MariaDB for ombi (3.0.5) By VSC55

Generate file "database.json":
- Saving in (/config/database.json)... [✓]

MySQL > Connecting... [✓]
- Reading   [............................................................] 0/1
- Error: Table "__efmigrationshistory" requiered is not exist in the server MySQL!!!
Read tables [!!]

MySQL > Disconnecting... [✓]
root@e1d8067f0f4d:/migrate# ls /config
custom-cont-init.d  custom-services.d  database.json  Logs  migration.json  Ombi.db  OmbiExternal.db  OmbiSettings.db
root@e1d8067f0f4d:/migrate# cd /config
root@e1d8067f0f4d:~# cat database.json
{"OmbiDatabase": {"Type": "MySQL", "ConnectionString": "Server=localhost;Port=3306;Database=Ombi;User=ombi;Password=ombi"}, "SettingsDatabase": {"Type": "MySQL", "ConnectionString": "Server=localhost;Port=3306;Database=Ombi;User=ombi;Password=ombi"}, "ExternalDatabase": {"Type": "MySQL", "ConnectionString": "Server=localhost;Port=3306;Database=Ombi;User=ombi;Password=ombi"}}root@e1d8067f0f4d:~# exit
exit

Show the EFMigrationsHistory in Ombi.db efmigrationshistory not equal __EFMigrationsHistory

08:56:42 root@Batcave:~/.config/Ombi# ls
custom-cont-init.d  custom-services.d  database.json  Logs  migration.json  Ombi.db  OmbiExternal.db  OmbiSettings.db
08:56:45 root@Batcave:~/.config/Ombi# sqlite3 Ombi.db
SQLite version 3.34.1 2021-01-20 14:10:07
Enter ".help" for usage hints.
sqlite> .show
        echo: off
         eqp: off
     explain: auto
     headers: off
        mode: list
   nullvalue: ""
      output: stdout
colseparator: "|"
rowseparator: "\n"
       stats: off
       width:
    filename: Ombi.db
sqlite> .tables
AlbumRequests                MovieRequests
AspNetRoleClaims             NotificationTemplates
AspNetRoles                  NotificationUserId
AspNetUserClaims             RecentlyAddedLog
AspNetUserLogins             RequestLog
AspNetUserRoles              RequestQueue
AspNetUserTokens             RequestSubscription
AspNetUsers                  SeasonRequests
Audit                        Tokens
ChildRequests                TvRequests
EpisodeRequests              UserNotificationPreferences
IssueCategory                UserQualityProfiles
IssueComments                Votes
Issues                       __EFMigrationsHistory
MobileDevices
sqlite>
rabidwoodlouse commented 2 years ago

When i create only database,json, Ombi crash :/

vsc55 commented 2 years ago

Hi @rabidwoodlouse, Is it correct if I suppose you are using the official ombi docker? As far as I know that docker doesn't have a mysql server, so you can't use the --host localhost or --host 127.0.0.1 setting. You will have to change the value to the IP of the MySQL server. Assuming your server is on the ip 192.168.1.100 run the following commands:

# python ombi_sqlite2mysql.py -c /config --only_db_json --host 192.168.1.100 --db Ombi --user ombi --passwd ombi
# ombi --migrate
# python ombi_sqlite2mysql.py -c /config --host 192.168.1.100 --db Ombi --user ombi --passwd ombi

Update: Image: linuxserver/ombi:development

rabidwoodlouse commented 2 years ago

Hello @vsc55,

Yes, but i have been mount volume /var/run/mysqld for use localhost for socket mysql. I use offical development ombi docker image:

08:59:16 root@Batcave:/home/rabidwoodlouse# cat /etc/systemd/system/ombi.service                                                                                                                                                                                                                                             
[Unit]
Description=Ombi Service Docker
BindsTo=docker.service
After=docker.service

[Service]
Environment=NAME=ombi
Restart=on-failure
RestartSec=10
ExecStartPre=-/usr/bin/docker kill ${NAME}
ExecStartPre=-/usr/bin/docker rm ${NAME}
ExecStart=/usr/bin/docker run --name ${NAME} \
    -e PUID=120 \
    -e PGID=120 \
    -p 5000:3579 \
    -v /root/.config/Ombi:/config \
    -v /root/ombi_sqlite_mysql:/migrate \
    -v /var/run/mysqld:/var/run/mysqld \
    linuxserver/ombi:development
ExecStop=/usr/bin/docker stop linuxserver/ombi
[Install]
WantedBy=multi-user.target

08:59:42 root@Batcave:/home/rabidwoodlouse# id ombi
uid=113(ombi) gid=120(ombi) groups=120(ombi)
rabidwoodlouse commented 2 years ago
09:11:55 root@Batcave:/home/rabidwoodlouse# docker exec -it ombi /bin/bash
root@fb9ecb44b7df:/# apt update; apt install python3 python3-mysqldb -y;
Get:1 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic/multiverse Sources [216 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic/universe Sources [11.5 MB]
Get:6 http://archive.ubuntu.com/ubuntu bionic/main Sources [1,063 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic/restricted Sources [5,823 B]
Get:8 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1,344 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]
Get:11 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse Sources [18.1 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/universe Sources [596 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/restricted Sources [29.1 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/main Sources [651 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [725 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [34.4 kB]
Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [2,230 kB]
Get:19 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2,898 kB]
Get:20 http://archive.ubuntu.com/ubuntu bionic-security/universe Sources [363 kB]
Get:21 http://archive.ubuntu.com/ubuntu bionic-security/restricted Sources [25.6 kB]
Get:22 http://archive.ubuntu.com/ubuntu bionic-security/main Sources [326 kB]
Get:23 http://archive.ubuntu.com/ubuntu bionic-security/multiverse Sources [8,784 B]
Get:24 http://archive.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [26.8 kB]
Get:25 http://archive.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [691 kB]
Get:26 http://archive.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1,452 kB]
Get:27 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages [2,461 kB]
Fetched 38.6 MB in 3s (12.1 MB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  file libexpat1 libmagic-mgc libmagic1 libmpdec2 libmysqlclient20 libpython3-stdlib libpython3.6-minimal libpython3.6-stdlib libreadline7 mime-support mysql-common python3-minimal python3.6 python3.6-minimal readline-common xz-utils
Suggested packages:
  python3-doc python3-tk python3-venv default-mysql-server | virtual-mysql-server python-egenix-mxdatetime python3-mysqldb-dbg python3.6-venv python3.6-doc binutils binfmt-support readline-doc
The following NEW packages will be installed:
  file libexpat1 libmagic-mgc libmagic1 libmpdec2 libmysqlclient20 libpython3-stdlib libpython3.6-minimal libpython3.6-stdlib libreadline7 mime-support mysql-common python3 python3-minimal python3-mysqldb python3.6 python3.6-minimal readline-common xz-utils
0 upgraded, 19 newly installed, 0 to remove and 0 not upgraded.
Need to get 5,607 kB of archives.
After this operation, 33.0 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3.6-minimal amd64 3.6.9-1~18.04ubuntu1.6 [534 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libexpat1 amd64 2.2.5-3ubuntu0.2 [80.5 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3.6-minimal amd64 3.6.9-1~18.04ubuntu1.6 [1,609 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3-minimal amd64 3.6.7-1~18.04 [23.7 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic/main amd64 mime-support all 3.60ubuntu1 [30.1 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic/main amd64 libmpdec2 amd64 2.4.2-1ubuntu1 [84.1 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic/main amd64 readline-common all 7.0-3 [52.9 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic/main amd64 libreadline7 amd64 7.0-3 [124 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3.6-stdlib amd64 3.6.9-1~18.04ubuntu1.6 [1,712 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3.6 amd64 3.6.9-1~18.04ubuntu1.6 [203 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3-stdlib amd64 3.6.7-1~18.04 [7,240 B]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3 amd64 3.6.7-1~18.04 [47.2 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libmagic-mgc amd64 1:5.32-2ubuntu0.4 [184 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libmagic1 amd64 1:5.32-2ubuntu0.4 [68.6 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 file amd64 1:5.32-2ubuntu0.4 [22.1 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic/main amd64 xz-utils amd64 5.2.2-1.3 [83.8 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic/main amd64 mysql-common all 5.8+1.0.4 [7,308 B]
Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libmysqlclient20 amd64 5.7.36-0ubuntu0.18.04.1 [689 kB]
Get:19 http://archive.ubuntu.com/ubuntu bionic/main amd64 python3-mysqldb amd64 1.3.10-1build1 [46.0 kB]
Fetched 5,607 kB in 0s (34.3 MB/s)
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76, <> line 19.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7, <> line 19.)
debconf: falling back to frontend: Teletype
Selecting previously unselected package libpython3.6-minimal:amd64.
(Reading database ... 7318 files and directories currently installed.)
Preparing to unpack .../libpython3.6-minimal_3.6.9-1~18.04ubuntu1.6_amd64.deb ...
Unpacking libpython3.6-minimal:amd64 (3.6.9-1~18.04ubuntu1.6) ...
Selecting previously unselected package libexpat1:amd64.
Preparing to unpack .../libexpat1_2.2.5-3ubuntu0.2_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.5-3ubuntu0.2) ...
Selecting previously unselected package python3.6-minimal.
Preparing to unpack .../python3.6-minimal_3.6.9-1~18.04ubuntu1.6_amd64.deb ...
Unpacking python3.6-minimal (3.6.9-1~18.04ubuntu1.6) ...
Setting up libpython3.6-minimal:amd64 (3.6.9-1~18.04ubuntu1.6) ...
Setting up libexpat1:amd64 (2.2.5-3ubuntu0.2) ...
Setting up python3.6-minimal (3.6.9-1~18.04ubuntu1.6) ...
Selecting previously unselected package python3-minimal.
(Reading database ... 7565 files and directories currently installed.)
Preparing to unpack .../0-python3-minimal_3.6.7-1~18.04_amd64.deb ...
Unpacking python3-minimal (3.6.7-1~18.04) ...
Selecting previously unselected package mime-support.
Preparing to unpack .../1-mime-support_3.60ubuntu1_all.deb ...
Unpacking mime-support (3.60ubuntu1) ...
Selecting previously unselected package libmpdec2:amd64.
Preparing to unpack .../2-libmpdec2_2.4.2-1ubuntu1_amd64.deb ...
Unpacking libmpdec2:amd64 (2.4.2-1ubuntu1) ...
Selecting previously unselected package readline-common.
Preparing to unpack .../3-readline-common_7.0-3_all.deb ...
Unpacking readline-common (7.0-3) ...
Selecting previously unselected package libreadline7:amd64.
Preparing to unpack .../4-libreadline7_7.0-3_amd64.deb ...
Unpacking libreadline7:amd64 (7.0-3) ...
Selecting previously unselected package libpython3.6-stdlib:amd64.
Preparing to unpack .../5-libpython3.6-stdlib_3.6.9-1~18.04ubuntu1.6_amd64.deb ...
Unpacking libpython3.6-stdlib:amd64 (3.6.9-1~18.04ubuntu1.6) ...
Selecting previously unselected package python3.6.
Preparing to unpack .../6-python3.6_3.6.9-1~18.04ubuntu1.6_amd64.deb ...
Unpacking python3.6 (3.6.9-1~18.04ubuntu1.6) ...
Selecting previously unselected package libpython3-stdlib:amd64.
Preparing to unpack .../7-libpython3-stdlib_3.6.7-1~18.04_amd64.deb ...
Unpacking libpython3-stdlib:amd64 (3.6.7-1~18.04) ...
Setting up python3-minimal (3.6.7-1~18.04) ...
Selecting previously unselected package python3.
(Reading database ... 8017 files and directories currently installed.)
Preparing to unpack .../0-python3_3.6.7-1~18.04_amd64.deb ...
Unpacking python3 (3.6.7-1~18.04) ...
Selecting previously unselected package libmagic-mgc.
Preparing to unpack .../1-libmagic-mgc_1%3a5.32-2ubuntu0.4_amd64.deb ...
Unpacking libmagic-mgc (1:5.32-2ubuntu0.4) ...
Selecting previously unselected package libmagic1:amd64.
Preparing to unpack .../2-libmagic1_1%3a5.32-2ubuntu0.4_amd64.deb ...
Unpacking libmagic1:amd64 (1:5.32-2ubuntu0.4) ...
Selecting previously unselected package file.
Preparing to unpack .../3-file_1%3a5.32-2ubuntu0.4_amd64.deb ...
Unpacking file (1:5.32-2ubuntu0.4) ...
Selecting previously unselected package xz-utils.
Preparing to unpack .../4-xz-utils_5.2.2-1.3_amd64.deb ...
Unpacking xz-utils (5.2.2-1.3) ...
Selecting previously unselected package mysql-common.
Preparing to unpack .../5-mysql-common_5.8+1.0.4_all.deb ...
Unpacking mysql-common (5.8+1.0.4) ...
Selecting previously unselected package libmysqlclient20:amd64.
Preparing to unpack .../6-libmysqlclient20_5.7.36-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libmysqlclient20:amd64 (5.7.36-0ubuntu0.18.04.1) ...
Selecting previously unselected package python3-mysqldb.
Preparing to unpack .../7-python3-mysqldb_1.3.10-1build1_amd64.deb ...
Unpacking python3-mysqldb (1.3.10-1build1) ...
Setting up readline-common (7.0-3) ...
Setting up mime-support (3.60ubuntu1) ...
Setting up libreadline7:amd64 (7.0-3) ...
Setting up mysql-common (5.8+1.0.4) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Setting up libmagic-mgc (1:5.32-2ubuntu0.4) ...
Setting up libmagic1:amd64 (1:5.32-2ubuntu0.4) ...
Setting up xz-utils (5.2.2-1.3) ...
update-alternatives: using /usr/bin/xz to provide /usr/bin/lzma (lzma) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/lzma.1.gz because associated file /usr/share/man/man1/xz.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/unlzma.1.gz because associated file /usr/share/man/man1/unxz.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzcat.1.gz because associated file /usr/share/man/man1/xzcat.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzmore.1.gz because associated file /usr/share/man/man1/xzmore.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzless.1.gz because associated file /usr/share/man/man1/xzless.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzdiff.1.gz because associated file /usr/share/man/man1/xzdiff.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzcmp.1.gz because associated file /usr/share/man/man1/xzcmp.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzgrep.1.gz because associated file /usr/share/man/man1/xzgrep.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzegrep.1.gz because associated file /usr/share/man/man1/xzegrep.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzfgrep.1.gz because associated file /usr/share/man/man1/xzfgrep.1.gz (of link group lzma) doesn't exist
Setting up libmysqlclient20:amd64 (5.7.36-0ubuntu0.18.04.1) ...
Setting up libmpdec2:amd64 (2.4.2-1ubuntu1) ...
Setting up libpython3.6-stdlib:amd64 (3.6.9-1~18.04ubuntu1.6) ...
Setting up python3.6 (3.6.9-1~18.04ubuntu1.6) ...
Setting up file (1:5.32-2ubuntu0.4) ...
Setting up libpython3-stdlib:amd64 (3.6.7-1~18.04) ...
Setting up python3 (3.6.7-1~18.04) ...
running python rtupdate hooks for python3.6...
running python post-rtupdate hooks for python3.6...
Setting up python3-mysqldb (1.3.10-1build1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
root@fb9ecb44b7df:/# cd /migrate/
root@fb9ecb44b7df:/migrate# python3 ombi_sqlite2mysql.py -c /config --only_db_json --host 127.0.0.1 --db Ombi --user ombi --passwd ombi
Migration tool from SQLite to MySql/MariaDB for ombi (3.0.5) By VSC55

Generate file "database.json":
- Saving in (/config/database.json)... [✓]

root@fb9ecb44b7df:/migrate# /opt/ombi/Ombi --migrate
Hello, welcome to Ombi
Valid options are:
Ombi 4.7.11
Copyright (C) 2021 Ombi

  --host       (Default: http://*:5000) Set to a semicolon-separated (;) list of
               URL prefixes to which the server should respond. For example,
               http://localhost:123. Use "localhost" to indicate that the server
               should listen for requests on any IP address or hostname using
               the specified port and protocol (for example,
               http://localhost:5000). The protocol (http:// or https://) must
               be included with each URL. Supported formats vary between
               servers.

  --storage    Storage path, where we save the logs and database

  --baseurl    The base URL for reverse proxy scenarios

  --demo       Demo mode, you will never need to use this, fuck that fruit
               company...

  --migrate    Will run the migrations then exit the application

  --help       Display this help screen.

  --version    Display version information.

Migrate in progress...
Migrate complete.
root@fb9ecb44b7df:/migrate# python3 ombi_sqlite2mysql.py -c /config --host 127.0.0.1 --db Ombi --user ombi --passwd ombi
Migration tool from SQLite to MySql/MariaDB for ombi (3.0.5) By VSC55

Generate file "database.json":
- Saving in (/config/database.json)... [✓]

MySQL > Connecting... [!!]
* MySQL Error [2003]: Can't connect to MySQL server on '127.0.0.1' (111)
root@fb9ecb44b7df:/migrate#
09:19:50 root@Batcave:/home/rabidwoodlouse# cat /etc/mysql/mariadb.conf.d/50-server.cnf
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see

# this is read by the standalone daemon and embedded servers
[server]

# this is only for the mysqld standalone daemon
[mysqld]

#
# * Basic Settings
#

user                    = mysql
pid-file                = /run/mysqld/mysqld.pid
basedir                 = /usr
datadir                 = /var/lib/mysql
tmpdir                  = /tmp
lc-messages-dir         = /usr/share/mysql
lc-messages             = en_US
skip-external-locking

# Broken reverse DNS slows down connections considerably and name resolve is
# safe to skip if there are no "host by domain name" access grants
#skip-name-resolve

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 127.0.0.1

#
# * Fine Tuning
#

#key_buffer_size        = 128M
#max_allowed_packet     = 1G
#thread_stack           = 192K
#thread_cache_size      = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
#myisam_recover_options = BACKUP
#max_connections        = 100
#table_cache            = 64

#
# * Logging and Replication
#

# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# Recommend only changing this at runtime for short testing periods if needed!
#general_log_file       = /var/log/mysql/mysql.log
#general_log            = 1

# When running under systemd, error logging goes via stdout/stderr to journald
# and when running legacy init error logging goes to syslog due to
# /etc/mysql/conf.d/mariadb.conf.d/50-mysqld_safe.cnf
# Enable this if you want to have error logging into a separate file
#log_error = /var/log/mysql/error.log
# Enable the slow query log to see queries with especially long duration
#slow_query_log_file    = /var/log/mysql/mariadb-slow.log
#long_query_time        = 10
#log_slow_verbosity     = query_plan,explain
#log-queries-not-using-indexes
#min_examined_row_limit = 1000

# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id              = 1
#log_bin                = /var/log/mysql/mysql-bin.log
expire_logs_days        = 10
#max_binlog_size        = 100M

#
# * SSL/TLS
#

# For documentation, please read
# https://mariadb.com/kb/en/securing-connections-for-client-and-server/
#ssl-ca = /etc/mysql/cacert.pem
#ssl-cert = /etc/mysql/server-cert.pem
#ssl-key = /etc/mysql/server-key.pem
#require-secure-transport = on

#
# * Character sets
#

# MySQL/MariaDB default is Latin1, but in Debian we rather default to the full
# utf8 4-byte character set. See also client.cnf
character-set-server  = utf8mb4
collation-server      = utf8mb4_general_ci

#
# * InnoDB
#

# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
# Most important is to give InnoDB 80 % of the system RAM for buffer use:
# https://mariadb.com/kb/en/innodb-system-variables/#innodb_buffer_pool_size
#innodb_buffer_pool_size = 8G

# this is only for embedded server
[embedded]

# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]

# This group is only read by MariaDB-10.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.5]
rabidwoodlouse commented 2 years ago

I have change line bind-address = 127.0.0.1 with bind-address = myipserver

the result is same with localhost


root@e016c6386543:/migrate# python3 ombi_sqlite2mysql.py -c /config --host 149.202.xx.xx --db Ombi --user ombi --passwd ombi
Migration tool from SQLite to MySql/MariaDB for ombi (3.0.5) By VSC55

Generate file "database.json":
- Saving in (/config/database.json)... [✓]

MySQL > Connecting... [✓]
- Reading   [............................................................] 0/1
- Error: Table "__efmigrationshistory" requiered is not exist in the server MySQL!!!
Read tables [!!]

MySQL > Disconnecting... [✓]
rabidwoodlouse commented 2 years ago

Oh !!! I have been restart ombi docker and now i have tables !!! Good news ! :)


09:43:33 root@Batcave:~/.config/Ombi# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 40
Server version: 10.5.12-MariaDB-0+deb11u1 Debian 11

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use Ombi;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [Ombi]> show tables;
+-----------------------------+
| Tables_in_Ombi              |
+-----------------------------+
| AlbumRequests               |
| ApplicationConfiguration    |
| AspNetRoleClaims            |
| AspNetRoles                 |
| AspNetUserClaims            |
| AspNetUserLogins            |
| AspNetUserRoles             |
| AspNetUserTokens            |
| AspNetUsers                 |
| Audit                       |
| ChildRequests               |
| EpisodeRequests             |
| GlobalSettings              |
| IssueCategory               |
| IssueComments               |
| Issues                      |
| MobileDevices               |
| MovieRequests               |
| NotificationTemplates       |
| NotificationUserId          |
| RecentlyAddedLog            |
| RequestLog                  |
| RequestQueue                |
| RequestSubscription         |
| SeasonRequests              |
| Tokens                      |
| TvRequests                  |
| UserNotificationPreferences |
| UserQualityProfiles         |
| Votes                       |
| __EFMigrationsHistory       |
+-----------------------------+
31 rows in set (0.000 sec)

MariaDB [Ombi]>

But same error :/

root@79c35fd33a8b:/migrate# python3 ombi_sqlite2mysql.py -c /config --host 149.202.xx.xx --db Ombi --user ombi --passwd ombi
Migration tool from SQLite to MySql/MariaDB for ombi (3.0.5) By VSC55

Generate file "database.json":
- Saving in (/config/database.json)... [✓]

MySQL > Connecting... [✓]
- Reading   [............................................................] 0/1
- Error: Table "__efmigrationshistory" requiered is not exist in the server MySQL!!!
Read tables [!!]

MySQL > Disconnecting... [✓]
root@79c35fd33a8b:/migrate#
vsc55 commented 2 years ago

Hi @rabidwoodlouse, It seems to be a by a configuration in the database. You can run the following command to see how you have mariadb configured: show variables where Variable_name = 'lower_case_table_names' https://dev.mysql.com/doc/refman/8.0/en/identifier-case-sensitivity.html

rabidwoodlouse commented 2 years ago
MariaDB [(none)]> show variables where Variable_name = 'lower_case_table_names';
+------------------------+-------+
| Variable_name          | Value |
+------------------------+-------+
| lower_case_table_names | 0     |
+------------------------+-------+
1 row in set (0.001 sec)

MariaDB [(none)]>

It's default Unix Mariadb configuration: https://mariadb.com/docs/reference/mdb/system-variables/lower_case_table_names/

rabidwoodlouse commented 2 years ago

I have drop user and database mariadb, change configuration for lower = 1 in configuration file mariadb. restart mariadb and recreate database ombi and user with grant access. Change database.json "Ombi" name database to "ombi" Start docker container Ombi and migrate. Play python3 ombi_sqlite2mysql.py -c /config --host my_ip_serv --db ombi --user ombi --passwd ombi

rabidwoodlouse commented 2 years ago
12:19:24 root@Batcave:~/.config/Ombi# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 51
Server version: 10.5.12-MariaDB-0+deb11u1 Debian 11

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use ombi;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [ombi]> show tables;
+--------------------------------------------------------------+
| Tables_in_ombi                                               |
+--------------------------------------------------------------+
| __efmigrationshistory                                        |
| __efmigrationshistory_migration_backup_20211222111259_497837 |
| albumrequests                                                |
| applicationconfiguration                                     |
| aspnetroleclaims                                             |
| aspnetroles                                                  |
| aspnetuserclaims                                             |
| aspnetuserlogins                                             |
| aspnetuserroles                                              |
| aspnetusers                                                  |
| aspnetusertokens                                             |
| audit                                                        |
| childrequests                                                |
| couchpotatocache                                             |
| embycontent                                                  |
| embyepisode                                                  |
| episoderequests                                              |
| globalsettings                                               |
| issuecategory                                                |
| issuecomments                                                |
| issues                                                       |
| jellyfincontent                                              |
| jellyfinepisode                                              |
| lidarralbumcache                                             |
| lidarrartistcache                                            |
| mobiledevices                                                |
| movierequests                                                |
| notificationtemplates                                        |
| notificationuserid                                           |
| plexepisode                                                  |
| plexseasonscontent                                           |
| plexservercontent                                            |
| radarrcache                                                  |
| recentlyaddedlog                                             |
| requestlog                                                   |
| requestqueue                                                 |
| requestsubscription                                          |
| seasonrequests                                               |
| sickragecache                                                |
| sickrageepisodecache                                         |
| sonarrcache                                                  |
| sonarrepisodecache                                           |
| tokens                                                       |
| tvrequests                                                   |
| usernotificationpreferences                                  |
| userqualityprofiles                                          |
| votes                                                        |
+--------------------------------------------------------------+
47 rows in set (0.000 sec)

MariaDB [ombi]>
rabidwoodlouse commented 2 years ago
root@31ab7f93351d:/migrate# python3 ombi_sqlite2mysql.py -c /config --host 149.202.xx.xx --db ombi --user ombi --passwd ombi
Migration tool from SQLite to MySql/MariaDB for ombi (3.0.5) By VSC55

Generate file "database.json":
- Saving in (/config/database.json)... [✓]

MySQL > Connecting... [✓]
- Reading   [############################################################] 1/1
Read tables [✓]

Check migration.json:
- OmbiDatabase [SQLite >> Migrate]
- SettingsDatabase [SQLite >> Migrate]
- ExternalDatabase [SQLite >> Migrate]

Dump SQLite:
- OmbiDatabase      [############################################################] 974/974
- SettingsDatabase  [############################################################] 25/25
- ExternalDatabase  [############################################################] 11040/11040

Start clean tables:
- [CLEAN ] -> applicationconfiguration -> rows: 4
- [CLEAN ] -> aspnetroles -> rows: 12
- [CLEAN ] -> aspnetuserroles -> rows: 43
- [CLEAN ] -> aspnetusers -> rows: 9
- [CLEAN ] -> childrequests -> rows: 2
- [CLEAN ] -> episoderequests -> rows: 264
- [CLEAN ] -> globalsettings -> rows: 12
- [CLEAN ] -> issuecategory -> rows: 3
- [CLEAN ] -> movierequests -> rows: 12
- [CLEAN ] -> notificationtemplates -> rows: 111
- [CLEAN ] -> plexepisode -> rows: 6043
- [CLEAN ] -> plexseasonscontent -> rows: 239
- [CLEAN ] -> plexservercontent -> rows: 450
- [CLEAN ] -> radarrcache -> rows: 372
- [CLEAN ] -> requestlog -> rows: 425
- [CLEAN ] -> seasonrequests -> rows: 12
- [CLEAN ] -> sonarrcache -> rows: 88
- [CLEAN ] -> sonarrepisodecache -> rows: 3827
- [CLEAN ] -> tvrequests -> rows: 2
- [CLEAN ] -> usernotificationpreferences -> rows: 33
- [CLEAN ] -> userqualityprofiles -> rows: 4
- [BACKUP] -> __efmigrationshistory
- [SKIP  ] -> __efmigrationshistory -> rows: 30

- Running   [############################################################] 23/23
Clean tables [✓]

Start Migration:
- Preparing [############################################################] 12051/12051
ombi_sqlite2mysql.py:464: Warning: (1265, "Data truncated for column 'LastLoggedIn' at row 1")
  cur.execute(i)
ombi_sqlite2mysql.py:464: Warning: (1265, "Data truncated for column 'RequestedDate' at row 1")
  cur.execute(i)
ombi_sqlite2mysql.py:464: Warning: (1265, "Data truncated for column 'MarkedAsAvailable' at row 1")
  cur.execute(i)
ombi_sqlite2mysql.py:464: Warning: (1265, "Data truncated for column 'MarkedAsApproved' at row 1")
  cur.execute(i)
ombi_sqlite2mysql.py:464: Warning: (1265, "Data truncated for column 'RequestDate' at row 1")
  cur.execute(i)
ombi_sqlite2mysql.py:464: Warning: (1265, "Data truncated for column 'AddedAt' at row 1")
  cur.execute(i)
- Running   [############################################################] 11967/11967
- Checking  [############################################################] 46/46
Migration [✓]

MySQL > Disconnecting... [✓]
root@31ab7f93351d:/migrate#
vsc55 commented 2 years ago

Hi @rabidwoodlouse, It seems to me that I have already managed to make it work correctly on both windows and linux systems. You can try to see if now it no longer gives any error.

rabidwoodlouse commented 2 years ago

Hello @vsc55,

OK ! I have git pull your project and play after migrate :


root@24c85fccf06d:/migrate# python3 ombi_sqlite2mysql.py -c /config --host 149.202.xx.xx --db ombi --user ombi --passwd ombi
Migration tool from SQLite to MySql/MariaDB for ombi (3.0.5) By VSC55

Generate file "database.json":
- Saving in (/config/database.json)... [✓]

MySQL > Connecting... [✓]
- Reading   [############################################################] 1/1
Read tables [✓]

Check migration.json:
- OmbiDatabase [SQLite >> Migrate]
- SettingsDatabase [SQLite >> Migrate]
- ExternalDatabase [SQLite >> Migrate]

Dump SQLite:
- OmbiDatabase      [############################################################] 984/984
- SettingsDatabase  [############################################################] 26/26
- ExternalDatabase  [############################################################] 13733/13733

Start clean tables:
- [CLEAN ] -> applicationconfiguration -> rows: 4
- [CLEAN ] -> aspnetroles -> rows: 12
- [CLEAN ] -> aspnetuserroles -> rows: 43
- [CLEAN ] -> aspnetusers -> rows: 9
- [CLEAN ] -> childrequests -> rows: 2
- [CLEAN ] -> episoderequests -> rows: 264
- [CLEAN ] -> globalsettings -> rows: 12
- [CLEAN ] -> issuecategory -> rows: 3
- [CLEAN ] -> movierequests -> rows: 12
- [CLEAN ] -> notificationtemplates -> rows: 111
- [CLEAN ] -> plexepisode -> rows: 6097
- [CLEAN ] -> plexseasonscontent -> rows: 260
- [CLEAN ] -> plexservercontent -> rows: 450
- [CLEAN ] -> radarrcache -> rows: 372
- [CLEAN ] -> requestlog -> rows: 425
- [CLEAN ] -> seasonrequests -> rows: 12
- [CLEAN ] -> sonarrcache -> rows: 88
- [CLEAN ] -> sonarrepisodecache -> rows: 6441
- [CLEAN ] -> tvrequests -> rows: 2
- [CLEAN ] -> usernotificationpreferences -> rows: 33
- [CLEAN ] -> userqualityprofiles -> rows: 4
- [BACKUP] -> __efmigrationshistory
- [SKIP  ] -> __efmigrationshistory -> rows: 16

- Running   [############################################################] 23/23
Clean tables [✓]

Start Migration:
- Preparing [############################################################] 14755/14755
ombi_sqlite2mysql.py:492: Warning: (1265, "Data truncated for column 'LastLoggedIn' at row 1")
  cur.execute(i)
ombi_sqlite2mysql.py:492: Warning: (1265, "Data truncated for column 'RequestedDate' at row 1")
  cur.execute(i)
ombi_sqlite2mysql.py:492: Warning: (1265, "Data truncated for column 'MarkedAsAvailable' at row 1")
  cur.execute(i)
ombi_sqlite2mysql.py:492: Warning: (1265, "Data truncated for column 'MarkedAsApproved' at row 1")
  cur.execute(i)
ombi_sqlite2mysql.py:492: Warning: (1265, "Data truncated for column 'RequestDate' at row 1")
  cur.execute(i)
ombi_sqlite2mysql.py:492: Warning: (1265, "Data truncated for column 'AddedAt' at row 1")
  cur.execute(i)
- Running   [############################################################] 14671/14671
- [!!] -> __efmigrationshistory -> [SQLite (31) / MySQL (16)] = 15
- Checking  [############################################################] 46/46

Save Log Error Mysql Insert:
- Keeping in (/config/insert_error.log)... [✓]

MySQL > Disconnecting... [✓]
root@24c85fccf06d:/migrate#

Same errors :/

I have test drop ombi database and replay all task for migration, no change, same errors again

vsc55 commented 2 years ago

Hi @rabidwoodlouse,

Did you delete the tables before trying to migrate the data?

  1. Drop all tables from the database.
  2. Execute, changing the ip of the server.
    # python ombi_sqlite2mysql.py -c /config --only_db_json --host 192.168.1.100 --db Ombi --user ombi --passwd ombi
    # ombi --migrate
    # python ombi_sqlite2mysql.py -c /config --host 192.168.1.100 --db Ombi --user ombi --passwd ombi
rabidwoodlouse commented 2 years ago

Yes, it's same error.

Migration tool from SQLite to MySql/MariaDB for ombi (3.0.5) By VSC55

Generate file "database.json":
- Saving in (/config/database.json)... [✓]

MySQL > Connecting... [✓]
- Reading   [############################################################] 1/1
Read tables [✓]

Check migration.json:
- OmbiDatabase [SQLite >> Migrate]
- SettingsDatabase [SQLite >> Migrate]
- ExternalDatabase [SQLite >> Migrate]

Dump SQLite:
- OmbiDatabase      [############################################################] 984/984
- SettingsDatabase  [############################################################] 26/26
- ExternalDatabase  [############################################################] 13734/13734

Start clean tables:
- [CLEAN ] -> aspnetroles -> rows: 12
- [CLEAN ] -> aspnetuserroles -> rows: 43
- [CLEAN ] -> aspnetusers -> rows: 9
- [CLEAN ] -> childrequests -> rows: 2
- [CLEAN ] -> episoderequests -> rows: 264
- [CLEAN ] -> issuecategory -> rows: 3
- [CLEAN ] -> movierequests -> rows: 12
- [CLEAN ] -> notificationtemplates -> rows: 111
- [CLEAN ] -> requestlog -> rows: 45
- [BACKUP] -> __efmigrationshistory
- [SKIP  ] -> __efmigrationshistory -> rows: 15

- Running   [############################################################] 11/11
Clean tables [✓]

Start Migration:
- Preparing [############################################################] 14756/14756
ombi_sqlite2mysql.py:492: Warning: (1265, "Data truncated for column 'LastLoggedIn' at row 1")
  cur.execute(i)
ombi_sqlite2mysql.py:492: Warning: (1265, "Data truncated for column 'RequestedDate' at row 1")
  cur.execute(i)
ombi_sqlite2mysql.py:492: Warning: (1265, "Data truncated for column 'MarkedAsAvailable' at row 1")
  cur.execute(i)
ombi_sqlite2mysql.py:492: Warning: (1265, "Data truncated for column 'MarkedAsApproved' at row 1")
  cur.execute(i)
ombi_sqlite2mysql.py:492: Warning: (1265, "Data truncated for column 'RequestDate' at row 1")
  cur.execute(i)
ombi_sqlite2mysql.py:492: Warning: (1265, "Data truncated for column 'AddedAt' at row 1")
  cur.execute(i)
- Running   [############################################################] 14672/14672
- Checking  [############################################################] 46/46
Migration [✓]
rabidwoodlouse commented 2 years ago

Oh !! I just restart ombi docker and update my image to 4.8.0 and it's work !! Thank you very much @vsc55 ! You are the king !

vsc55 commented 2 years ago

Glad it works. Have a happy holiday season. 🎄🎄

rabidwoodlouse commented 2 years ago

You too! 🎅

Le jeu. 23 déc. 2021 à 19:34, Javier Pastor @.***> a écrit :

Glad it works. Have a happy holiday season. 🎄🎄

— Reply to this email directly, view it on GitHub https://github.com/vsc55/ombi_sqlite_mysql/issues/17#issuecomment-1000468376, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGXJ2HYE3H7IFF42OM37P7DUSNTUTANCNFSM47JFYTKQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>