Upgrading from 3.0.11 to 6.0.27 loses all data

Moderator: crythias

Post Reply
sedlacek
Znuny newbie
Posts: 2
Joined: 16 May 2020, 16:38
Znuny Version: 6.0.27
Real Name: Marek Sedláček
Company: UNIS a.s.

Upgrading from 3.0.11 to 6.0.27 loses all data

Post by sedlacek »

Hello,
for the last few months I was struggling with upgrading our old OTRS to the newest version.

We're running a 3.0.11 Windows version. I got the sqldump file with all the data for 3.0.11 version, but I'm just unable to upgrade to version 6, so far I was able to somewhat upgrade to version 5, but there has to be a problem, because upgrade from 5 to 6 causes the database to lose all the data.

I have to mention that the upgrade was not done the usual way using upgrade script, but instead by applying sql update scripts in the scripts/database folder. Because I was unable to install otrs 3 nor 4 on my computer (virtualbox with ubuntu) - And I've tried a lot of different approaches.

So, so far what somewhat worked (made otrs 5 run with data in it) was to put our sqldump to new database (with utf8 and same default engine (myisam)) and then I applied otrs-schema.mysql.sql after that otrs-schema-post.mysql.sql and then otrs-initial_insert.mysql.sql. And I did this with versions 3.1.1, 3.2.3, 3.3.1, 4.0.33, 5.0.42 and 6.0.27.

But the final version of the database is not as it should be based on documentation schema. Tables contain columns which should not be there and data are not correctly migrated to new tables. During the upgrade some of the scripts display errors with there being extra columns, which I deleted manually. But even though I fixed all the .sql scripts errors, the database scheme is still incorrect. I even went as far as manually checking all the tables and changing their scheme to fit the one in documentation, but the database contains extra tables and I, based on the picture in the documentation, don't know which columns were moved and which just deleted. So in the end this somewhat worked for version 5, where the article table is still used, but in version 6 the upgrade script itself deletes the whole article table, making the database lose most of the data.

I really don't know what else I could do to upgrade our database and so that's why I'm asking you. (Note: I'm not the most skilled person when it comes to SQL so there is a chance I messed up somewhere obvious to experts).

Thank you so much for any help or ideas.

TLDR: I tried upgrading from 3.0.11 (Windows) to 6.0.27 using /scripts/database schema, schema-post and initial_insert scripts, but somehow the database scheme is not correct and all data is lost or otrs cannot see it.
root
Administrator
Posts: 3961
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Upgrading from 3.0.11 to 6.0.27 loses all data

Post by root »

Hi,

Whatever you did there must have been an error in it. Who told you not to use the upgrade script? The SQL files you mention (otrs-schema*) are for NEW installations. Running version 3 and 4 may need an outdated Linux distribution with an older Perl version.

If you following the manual no data will be lost. E.g. version 6 does not only deleted the article table, but it also migrates the whole article data into a new structure.

I suggest starting over again, document every single step, and follow the documentation to succeed. Of hire a professional.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Upgrading from 3.0.11 to 6.0.27 loses all data

Post by jojo »

On newer versions you have to run the perl scripts and not just the database scripts. As Roy suggested you should hire a professional OTRS service provider
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
sedlacek
Znuny newbie
Posts: 2
Joined: 16 May 2020, 16:38
Znuny Version: 6.0.27
Real Name: Marek Sedláček
Company: UNIS a.s.

Re: Upgrading from 3.0.11 to 6.0.27 loses all data

Post by sedlacek »

Thanks for the suggestions and pointing out that schema is just for brand new database.
The reason why I did not use the upgrade script is because, as you said, I would need to use outdated version of linux with old perl, which I tried to avoid, but I guess that is not possible from what you're telling me.
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Upgrading from 3.0.11 to 6.0.27 loses all data

Post by jojo »

You have strictly to follow the upgrade instructions otherwise ist will fail
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Post Reply