Altered column order prevents SPIP database migration

On Fri, Jun 04, 2004 12:01:39 PM +0200, M. Fioretti
(mfioretti@mclink.it) wrote:

Result: it is not possible to dump a database with mysql from a
server with spip 1.7.1 and restore it automatically on another
server running 1.7.2. unless I waste time in a script to reorder the
fields in the mysql dump file. Is it really so?

Do I really have to install 1.7.1 on the new server, set it up, reload
the database, then upgrade to 1.7.2?

I have just gone through this just to discover that doesn't solve the
problem at all.

If I upgrade on the old server from 1.7 to 1.7-2 I end up with a
spip_articles table with the columns in this order:

....
| id_trad
| extra
| nom_site
| url_site
| id_version
| idx

When I install from scratch SPIP 1.7-2 on the new server it creates
tables with same columns in different orders. spip_articles ends like:

....
| id_trad
| nom_site
| url_site
| extra
| idx
| id_version

Consequence is always the same. File created with mysqldump on old
server cannot be loaded in new server, because column orders don't
match.

So:
1) how do I create a mysqldump file which has column names, in it, so
   they are assigned properly regardless of the order?

2) Does all this have to happen at all? Isn't it possible to guarantee
same column order from version to version?

Ciao,
Marco

1) how do I create a mysqldump file which has column names, in it, so
   they are assigned properly regardless of the order?

mysqldump --help ?

On Fri, Jun 04, 2004 17:32:48 PM +0200, M. Fioretti
(mfioretti@mclink.it) wrote:

So:
1) how do I create a mysqldump file which has column names, in it,
   so they are assigned properly regardless of the order?

Found this: the -c (complete) option to mysqldump does just that.

2) Does all this have to happen at all? Isn't it possible to
guarantee same column order from version to version?

Being as simple as above, I'll substitute this question with "this
issue should be documented in the upgrade article on the website,
shouldn't it?"

Thank you for your time,

Marco

> 2) Does all this have to happen at all? Isn't it possible to
> guarantee same column order from version to version?

Being as simple as above, I'll substitute this question with "this
issue should be documented in the upgrade article on the website,
shouldn't it?"

Well, unless I'm mistake, the upgrade article talks about using the SPIP
dump/restore facility, not the MySQL admin tools. That way you don't
bother with table column ordering or other annoying details. :wink:

Regards

Antoine.

On Fri, Jun 04, 2004 18:52:04 PM +0200, Antoine (antoine@pitrou.net)
wrote:

> > 2) Does all this have to happen at all? Isn't it possible to
> > guarantee same column order from version to version?
>
> Being as simple as above, I'll substitute this question with "this
> issue should be documented in the upgrade article on the website,
> shouldn't it?"

Well, unless I'm mistake, the upgrade article talks about using the SPIP
dump/restore facility, not the MySQL admin tools. That way you don't
bother with table column ordering or other annoying details. :wink:

I read that, and got the distinct impression (but of course it might
just be me not slepeping enough) that that procedure as is doesn't
work from one server to another. Was I wrong? And if it does, what
should be moved exactly from old to new server?

TIA,
Marco