|
3 | 3 | discogs-xml2db is a python program for importing [discogs data dumps](https://data.discogs.com/) |
4 | 4 | into several databases. |
5 | 5 |
|
6 | | -Version 2 is a rewrite of the original *discogs-xml2db* |
7 | | -(referred to here as the *classic* version). |
8 | | -It is based on a [branch by RedApple,](https://github.com/redapple/discogs-xml2db) |
9 | | -and it is several times faster. |
| 6 | +It exports to CSV as an intermediate step. |
| 7 | +It can then import these CSV files into MySQL, PostgreSQL, and SQLite |
| 8 | +through provided scripts/instructions. |
| 9 | + |
| 10 | +Instructions for importing into MongoDB, though these are untested. |
10 | 11 |
|
11 | | -Currently, it supports MySQL and PostgreSQL as target databases. |
12 | | -Instructions for importing into MongoDB, though these are untested. |
13 | 12 | Let us know how it goes! |
14 | 13 |
|
15 | 14 | ## Experimental version |
@@ -42,8 +41,12 @@ eventually replace it. |
42 | 41 |
|
43 | 42 | ### Requirements |
44 | 43 |
|
45 | | -**discogs-xml2db requires python3 (minimum 3.6)** and some python modules. |
46 | | -Additionally, the bash shell is used for automating some tasks. |
| 44 | +**discogs-xml2db requires python3** and some python modules. |
| 45 | +Additionally, the bash shell is used for automating some tasks. |
| 46 | + |
| 47 | +**Note**: the minimum version _tested_ is the one that still receives |
| 48 | +security updates according to <https://endoflife.date/python>. It |
| 49 | +might work with earlier versions, but no guarantees. |
47 | 50 |
|
48 | 51 | Importing to some databases may require additional dependencies, |
49 | 52 | see the documentation for your target database below. |
@@ -221,7 +224,7 @@ $ nano postgresql/postgresql.conf |
221 | 224 |
|
222 | 225 | # Configure primary keys and constraints, build indexes |
223 | 226 | (.discogsenv) $ python3 postgresql/psql.py < postgresql/sql/CreatePrimaryKeys.sql |
224 | | -(.discogsenv) $python3 postgresql/psql.py < postgresql/sql/CreateFKConstraints.sql |
| 227 | +(.discogsenv) $ python3 postgresql/psql.py < postgresql/sql/CreateFKConstraints.sql |
225 | 228 | (.discogsenv) $ python3 postgresql/psql.py < postgresql/sql/CreateIndexes.sql |
226 | 229 | ``` |
227 | 230 |
|
@@ -263,28 +266,6 @@ The CSV files can be imported into MongoDB using |
263 | 266 | mongoimport --db=discogs --collection=releases --type=csv --headerline --file=release.csv |
264 | 267 | ``` |
265 | 268 |
|
266 | | -#### Importing into CouchDB |
267 | | - |
268 | | -CouchDB only supports importing JSON files. |
269 | | -[`couchimport`](https://github.com/glynnbird/couchimport) can be used to convert |
270 | | -the CSV files to JSON and import them into CouchDB, |
271 | | -as explained in [this tutorial](https://medium.com/codait/simple-csv-import-for-couchdb-71616200b095). |
272 | | - |
273 | | -## Comparison to classic discogs-xml2db |
274 | | - |
275 | | -*speedup* is many times faster than *classic* because it uses a different approach: |
276 | | - |
277 | | -1. The discogs XML dumps are first converted into one csv file per database table. |
278 | | -2. These csv files are then imported into the different target databases (bulk load). |
279 | | - This is different from *classic* discogs-xml2db, which loads records into the database |
280 | | - one by one while parsing the XML file, waiting on the database after every row. |
281 | | - |
282 | | -*speedup* requires less disk space than *classic* as it can work while the dump files are still compressed. |
283 | | -While the uncompressed dumps for May 2020 take up 57GB of space, the compressed dumps are only 8.8GB. |
284 | | -The dumps can be deleted after converting them to compressed CSV files (6.1GB). |
285 | | - |
286 | | -As many databases can import CSV files out of the box, it should be easy |
287 | | -to add support for more databases to discogs-xml2db *speedup* in the future. |
288 | 269 |
|
289 | 270 | ### Database schema changes |
290 | 271 |
|
|
0 commit comments