Migration: 0.19.3/mySQL -> 1.0.0rc3/postgreSQL

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Tosk
Posts: 1
Joined: 01 Dec 2005, 17:22

Migration: 0.19.3/mySQL -> 1.0.0rc3/postgreSQL

Post by Tosk »

Hi,

i want to move our greate mantis-system from Server A (running mantis 0.19.3/mySQL) to a new Server B. There are approximately 1700 bugs in the Database.

On Server B is an existing postgreSQL-Database, so i want to use this one for the new mantis system.

How can i do this migration? I think 0.19.3 to 1.0.0rc3 is easy, but how should i switch the Database-Systems? What steps do you suggest for the migration??

Many many thanx for your help and greatings from Aachen/Germany!

Tosk

PS: Systems: Linux/Apache, and i could be "root" on both Servers. ;-)
Guest

Post by Guest »

Hi Tosk,

i have done this task almost, but i get stucked in some problems.

I did a migration from 1.0.0rc1 (MySql) to 1.0.0rc4 (PgSql)

That's what i've done so far:

- Create a clean install off mantis on your webserver
- Let Mantis populate your pgsql database
- Maybe your migrate to 1.0.0rc4 first (changed db structure!)
- Dump your MySql database eg:

Code: Select all

mysqldump -n -t --databases your_db -u your_user --password=your_secret >db_mantis.sql
- edit db_mantis.sql:
comment all entries of mantis_upgrade_table and mantis_config_table
comment "administrator" in mantis_user_table, he's already created
look for correct date format ( wrong: "0000-00-00 00:00:00", correct: "1970-01-01 00:00:00")
set the correct encoding: older versions of mysql dumps the data in LATIN1 newer ones as UTF8 (put

Code: Select all

\encoding LATIN1
in the very first line of your script)
- now import your data into PgSql:

Code: Select all

psql -U your_user -d your_db -f db_mantis.sql
- no errors should be displayed
- all data is migrated
- but ....

Here are my problems:
- Uploaded files (stored in the db) are corrupted (incomp: export/import)
- if i add new bugs there some errors about "duplicate key"....

can anyone help? (Thanks!)

Hints:
if you use UTF8 as standard encoding in your database, you need to tell pgsql to represent the data (for mantis) as LATIN1 (set names 'LATIN1', see also http://manual.mantisbt.org/manual.confi ... tabase.php)

PS: I am not a db specialist, maybe there is better way to perform this task. Any suggestions are welcome :-)
Guest

Post by Guest »

^^^^ Uhpsss! I forgot:

Old system:
Windows 2000 Pro
Apache 2.0.53
MySql 4.0.12
PHP 4.3.10
Mantis 1.0.0rc3

New system:
Windows 2000 Server
Apache 2.0.55
PgSql 8.1.1
PHP 5.1.1
Mantis 1.0.0rc4

PS: I wish, I had linux ;-)
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

I wrote some code once that used ADODB to basically connect to one server, grab a few lines from a table, connect to the other server and dump them.

That way, in theory, I had no problems as ADODB did the translations for me. At the time, however, I was only ever able to check this with MySQL. If anyone thinks it's possible, I will try and find a spot to put this code and that might help.

That is, assuming I can find it again :)
vboctor
Site Admin
Posts: 1304
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Post by vboctor »

I've a couple of recommendations for this migration process:

- Upgrade to the latest Mantis version on MySQL before doing the migration to PgSQL, do not move from Mantis version A on MySQL to Mantis version B on PgSQL.

- It is recommended to have your attachments outside the database. If you already have them in the database, then you can use the system utility in the admin/ folder to extract them from the database and put them on disk.

I haven't really done any work on PgSQL, so I can't help with the exact steps.

Regards,
Victor
MantisConnect
http://www.futureware.biz/mantisconnect/
Post Reply