-
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
Error converting DB type to Postgres #24065
Comments
@Xenopathic From what i know you can only convert from SQLite to either MySQL or PostgreSQL, not convert from MySQL to PostgreSQL. The tool was never designed to switch between MySQL and PostgreSQL. |
Ok, i might be wrong. Confused this with the info that you can't go back from MySQL or PostgreSQL to SQLite: #6457 |
@Xenopathic it more likely looks like one of your vcards contains special characters. Or something is not escaped properly when reading the values ? |
The only special character in that vcard compared to others is a literal backlash. Strange why that's causing issues, they are getting correctly escaped (double backslash) when being passed to Postgres EDIT: Actually I lie, there's also commas, but I strongly doubt that is causing the problems |
Yeah, looks like it's the backslash. I modified that failing entry to remove it, and now a different entry in oc_calendarobjects is failing (this one I don't need to redact):
Notice the entry contains (literal) |
The same issue happens to me. Running ownCloud 9.0.1 and PostgreSQL 9.4. I'm trying to convert from sqlite3 to pgsql. After I deleted data in oc_cards and oc_calendarobjects tables it stops now somewhere in oc_preferences I guess.. |
@piotr277 That looks like a different issue, I'd suggest opening a new issue report |
@Xenopathic These may be connected. I've encountered the same problem as you
until I've removed data from oc_cards and oc_calendarobjects tables.
happens not only during conversion: mysql > pgsql, but sqlite > pgsql as well. |
|
Have you been able to success in migrating from mysql to postgresql? I'm exactly in the same situation, facing the same problem, and have not been able to find any good answer. |
Any fix for this issue? I'm running into it right now while trying to convert between mysql and postgresql.
|
Quick workaround:
Same probably needs to be done for Calendars (https://doc.owncloud.org/server/8.2/user_manual/pim/calendar.html#special-caldav-urls) |
Even on small installations neither quick nor a workaround :) I added a str_replace() to the conversion. I don't know if it breaks anything else but at least the conversion finished without errors and data is accessable. Maybe someone from OC team could have a look at this? Is some escaping of the values done before to avoid SQL syntax issues?
|
The sequences of my postgres (target of db conversion) where not resynchronized resulting in dup key errors while trying to create a (e.g.) new calendar entry. But I don't understand how this is possible during conversion without an error. I did: sudo -u apache ./occ db:convert-type --clear-schema --port=5432 --password=foo pgsql owncloud localhost owncloud Anyway, attached is a PHP script I used to fix the sequences. Looking into ConvertType.php offers a better solution ;) |
Hey, this issue has been closed because the label (This is an automated comment from GitMate.io. |
Convert-type is currently broken: #27075. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
My current ownCloud installation uses MySQL, and I wanted to use the occ
db:convert-type
command to convert it to using PostgreSQL. The command runs successfully for many tables, but fails when copying data in theoc_cards
table, with a 'Invalid input syntax for type bytea' error.Full error here:
Oddly, it managed to copy 22 records from
oc_cards
before hitting this error, and I've tried twice now and both times it was on this record.Running ownCloud 9.0.1 and PostgreSQL 9.5.2. I've also tried changing the
standard_conforming_strings
option fromon
tooff
, but no difference.@icewind1991 You know PostgreSQL, any ideas?
The text was updated successfully, but these errors were encountered: