Gentoo Archives: gentoo-user

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: mysql to postgresql migration
Date: Tue, 15 Jul 2014 19:06:49
Message-Id: cfa089fc-2291-41d3-b43a-5b78a13ea504@email.android.com
In Reply to: [gentoo-user] Re: mysql to postgresql migration by James
1 On 15 July 2014 19:40:14 CEST, James <wireless@×××××××××××.com> wrote:
2 >J. Roeleveld <joost <at> antarean.org> writes:
3 >
4 >
5 >> >I recently ran across this script: py-mysql2pgsql [1]
6 >> >and this discussion on it's origin [2]. I'm keenly interested
7 >> >in the recommendations of others for migrating mysql databases
8 >> >to postgresql and any comments on this aforementioned script
9 >> >or other methodologies....
10 >> >[1] https://github.com/philipsoutham/py-mysql2pgsql
11 >> >[2]
12 >> >http://www.tryolabs.com/Blog/2012/02/10/django-migrating-mysql-
13 >postgresql/
14 >> James,
15 >
16 >> I haven't looked into this recently. But I believe that the DDLs and
17 >data
18 >> can be migrated relatively easy.
19 >
20 >> Just be aware that software specifically written using MySQLs version
21 >of >
22 >SQL is unlikely to work on a different RDBMS without extensive
23 >rewrites.
24 >
25 >So, If you run the same program, say gnucash, on top of mysql, then
26 >migrate
27 >the mysql dB it to pgsql, it will require an extensive rewrite?
28
29 Not always. But if the software was written using the non standard SQL that is common when the developers only know MySQL then you are likely to find that the SQL is invalid for other databases.
30
31 >This shouild be an easy example, which is quite common (google).
32 >So, let's just say that I run across mysql --> pgsql quite often to the
33 >point that it's time for me to develop some slick_skills here.
34
35 I deal with migrations and integration projects on a daily basis as part of my job. Some are simple. Some require extensive skills and knowledge.
36
37 >> This is the biggest problem people are facing when porting websites
38 >> to use a different database.
39 >> What is the reason for migrating and what kind of data and
40 >> applications are you using?
41 >> Joost
42 >
43 >Another more serious problem:
44 >I'm not porting websites, but more working on science applications with
45 >huge data. Some of it is organized via mysql, others are more
46 >in the form of vary large test vectors (matricies) that are sparsely
47 >populated. Others portions are double float or other forms of
48 >scientific
49 >data. So in this case there is not a one-2-one semantic. But, I do
50 >need to extract (dump?) mysql into a form where I can later
51 >include it into a much larger, designed from the ground floor up,
52 >pgsql dB. I relaize this sort of effort is unique, but surely some
53 >additional slick_tools exist for this sort of effort?
54
55 The tools that exist to make these things easier require plenty of practice and experience to use properly.
56 For your usecase, if not too often, I would recommend exporting the DDL (all create table/index/.... statements) and export the table contents to CSV files (with headers to ensure data goes back to correct columns)
57
58 --
59 Joost
60
61
62 --
63 Sent from my Android device with K-9 Mail. Please excuse my brevity.