-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
occ db:convert-type doesn't work with migration #27075
Comments
I'm afraid that there will be no solution for this. Maybe convert-type needs to work differently: instead of using the schemas, just migrate whatever data is there regardless... in which case the command itself becomes generic and could be written as a completely separate tool (not part of ownCloud). I'm already hearing @DeepDiver1975 from far away saying "kill convert-type" 😉 |
Wait a minute... The option But the code seems to just through away the extra tables instead of doing so. But then it doesn't do anything. WTF |
Ok, found the code. Actually it finds the extra tables only for the warnings. So no luck there. |
😬 |
We could clear the migrations table on the target schema and run all migration steps for all apps. somthing like: ./occ migrations:migrate --all --restart |
You don't even need to clear the migration table, the convert script doesn't copy it over. My worry about running the migration scripts is that some might want to operate on existing data. But the data hasn't been copied over yet. On the other hand, the data in the source tables is already converted to whatever format is required by the migrations once they all ran. So it might work. I guess there can still be some possible migration scenarios where this wouldn't work, if for example a migration expects data to exist and fails if it doesn't (ex: some kind of orphaned share situation where the missing data wasn't copied yet to the target tables) |
We need to sort this out before final. So far I don't see any good solution apart from deprecating the tool... Or extracting it to be a general DB conversion tool not part of OC releases. |
Assigning to @DeepDiver1975 to make a decision |
We'll need a decision here, this feature will be completely broken in 10.0 and I don't see any possible solution because DB migrations work completely differently than what this feature here expects. I'd suggest removing this feature. Maybe a separate generic tool could be provided to convert a SQLite DB to MySQL but nothing bundled or OC specific. |
Let the command only say: |
not adding this now -> 10.0.1 I'm not even sure we can even make it work correctly without a huge effort, and I have the feeling that we don't have time to spend that effort for this little benefit. |
@pmaier1 how important is this feature ? I don't think it is fixable at all currently without major rework. Should we remove it and/or add a message that it doesn't work ? |
moving to triage for decision and scheduling |
kill? |
@ghost wrote,
I've installed owncloud 3 times today, and it took me this long to figure out how to follow the above advice. It turns out there is a "Storage & database" dropdown on that page, small and transparent on a detailed background, sandwiched between large, bright, opaque input objects like the login credentials fields and the "Finish installation" button. If you notice that little dropdown and click it, you get access to the ability to change database settings. If instead you first enter your credentials and press "Enter" to log in, as the primary elements at the top of the page suggest, you miss the chance to configure database settings. The warning that SQLite is discouraged, with documentation saying that you can migrate to something else once you get the service up and running, is very different from a warning that says use of SQLite is discouraged and it will be difficult to change later. When I was installing oc, and encountered the above message, I searched the documentation for how to choose MySQL instead of SQLite. All I found was advice about running occ to convert the database to MySQL after installation. So I went with that option. Of course that led down a frustrating trail. If you decide not to fix the conversion-to-MySQL tool, please make the Storage and Database settings on the installation page much more prominent. Make them visible instead of hidden by default. And maybe even ask for confirmation if the user tries to click the Finish Installation button with SQLite still selected, letting them know that there is not a conversion path from SQLite. |
or better: drop sqlite support altogether #29625 (comment) |
need time from QA at some point to test this when time permits @patrickjahns |
is there any news about the bug? Is there any workaround? |
you can help testing whether the PR works for you: #30643 |
After 2 years and no fix and now market app stopped working with SQLite. |
THX @VicDeo ! The above mentioned fix will be part of oC Server 10.3. Please try it and provide feedback here! |
Thanks @pmaier1 ! I have tested this on OwnCloud version 10.3.0 RC1. On migration from SQlite to MariaDB using the following syntax:
I receive the following errors:
|
@jacobklitzke sounds similar to #29445 |
ok. got it. The workaround is activated by Platform name and version. When migrations are generated the platform is not MariaDB (source DB is checked in lines below while MariaDB is a target DB ) https://github.com/owncloud/core/blob/master/lib/private/DB/MySqlSchemaColumnDefinitionListener.php#L51 |
@jacobklitzke I don't think it worth fixing as 10.4 will probably unlock doctrine/dbal 2.7 by dropping PHP 7.0. |
@VicDeo After making the change you recommended, the migration worked successfully. Thanks for all your help and work on this issue! BTW, I was using MariaDB 10.4.7. |
This change is being made because the database conversion command is currently broken. When owncloud/core#27075 is merged, this command can be re-enabled. This fixes #2254.
Worked for me: sqlite to mysql conversion with the official docs: https://doc.owncloud.com/server/10.5/admin_manual/configuration/database/db_conversion.html owncloud server 10.5.0.10 mysql-server 5.7.31-0ubuntu0.18.04.1 PHP 7.2.24-0ubuntu0.18.04.6 (but php 7.0 is also installed. No clue which one is used) |
Steps
occ db:convert-type
to convert to MySQLExpected
All tables migrated
Actual
Some tables were omitted:
oc_external_config
, etc. These tables are created not with MDB2 schemas but with migrations.Versions
master.
We need to adjust the command to also run the migrations on the new database to initially create the tables. I'm not sure if this will work correctly because a migration isn't always only creating tables...
@DeepDiver1975
The text was updated successfully, but these errors were encountered: