Skip to content

Conversation

@TobiasKaiser
Copy link
Contributor

The MySQL post-processing command in csv-to-mysql.php gave me a gew minor errors. Two SQL queries, which I discarded, referenced columns that were dropped from MW's DB schema. I added a query to fix values of the comment_data in the comment table.
I also removed two references to specific outdated MW versions.
In this form, the script worked for me when converting a MW 1.38 SQLite DB with almost no MW plugins installed to MySQL/MariaDB.

Copy link
Member

@jeffw16 jeffw16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I left a few comments

$sqlite_ext = '.sqlite';
$path_to_tables_file = '/path/to/tables-1.35.txt';
$sqlite_ext = 'sqlite';
$path_to_tables_file = '/path/to/tables-1.xx.txt';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a distinction that this is for the tables desired in the new version? Otherwise people might think this is the same as the other xx which is not true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression that the purpose of MediaWiki-SQLite-to-MySQL was to transfer data of a MediaWiki installation from SQLite to MySQL. Is it also meant for switching MediaWiki versions in the process? If not, xx should indeed be the same in both files.

Copy link
Member

@jeffw16 jeffw16 Jun 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TobiasKaiser it can do both, which is why the distinction should be made. The 1.31 vs. 1.35 in the old code, although hardcoded, was not a mistake.

csv-to-mysql.php Outdated

$path_to_tables_file = '/path/to/tables-1.xx.txt';
$path_to_schema_file = '/path/to/mediawiki-1.31.0-schema-with-confirmacct.sql';
$path_to_schema_file = '/path/to/mediawiki-1.xx-schema-with-confirmacct.sql';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a distinction here that it's referring to the old schema rather than the new schema?

@TobiasKaiser
Copy link
Contributor Author

TobiasKaiser commented Jun 20, 2022

As requested, the sample filenames now highlight that MediaWiki versions of input and output database can differ.

Copy link
Member

@jeffw16 jeffw16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jeffw16
Copy link
Member

jeffw16 commented Jun 20, 2022

Thanks @TobiasKaiser, merging this PR

@jeffw16 jeffw16 merged commit 66f8fb3 into mywikis:main Jun 20, 2022
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

Successfully merging this pull request may close these issues.

2 participants