Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. Migrating Openproject 8.3.2 with mySQL DBMS to new Server with newest OP version with PostgreSQL DBMS

Migrating Openproject 8.3.2 with mySQL DBMS to new Server with newest OP version with PostgreSQL DBMS

Added by Christian Bley over 4 years ago

Hello,

I have a production server running Openproject version 8.3.2 with mySQL as DBMS and want to migrate it to new server running the newest stable version of Openproject.

Since the support for mySQL was dropped in the meantime: Do I really need to migrate that DB to Postgres on my production server? Or is there a way to migrate the mySQL DB to the other server and then migrate it to Postgres?

I don't want to migrate the DB to PostgresSQL on the production server because it will eventually go out of service after migrating and I thought there may be a easier way and I don't want to risk any downtime.

thanks for your help :)


Replies (10)

RE: Migrating Openproject 8.3.2 with mySQL DBMS to new Server with newest OP version with PostgreSQL DBMS - Added by Christian Bley over 4 years ago

Am I missing something? I searched for instructions in the documentation but I just found an instruction for migrating the DB ON the server openproject runs on. And another instruction for migrating an Openproject instance with PostgreSQL to another server with PostgreSQL.

Greetings

RE: Migrating Openproject 8.3.2 with mySQL DBMS to new Server with newest OP version with PostgreSQL DBMS - Added by Christian Bley over 4 years ago

Meanwhile I found this: https://docs.openproject.org/installation-and-operations/misc/upgrading-older-openproject-versions/

But it states that it'll only work if I have a Docker installation. However I have an installation with DEB packages..

RE: Migrating Openproject 8.3.2 with mySQL DBMS to new Server with newest OP version with PostgreSQL DBMS - Added by Max Mutzge over 4 years ago

Hi Christian,
have you found these resources?
https://docs.openproject.org/installation-and-operations/misc/packaged-postgresql-migration/ (for packaged installations)
https://docs.openproject.org/installation-and-operations/misc/upgrading-older-openproject-versions/#re-installing-openproject (as an alternative)
https://docs.openproject.org/installation-and-operations/operation/upgrading/#upgrade-notes-for-8x-to-9x (basic approach and good to know)

Kind regards
Matthias

RE: Migrating Openproject 8.3.2 with mySQL DBMS to new Server with newest OP version with PostgreSQL DBMS - Added by Christian Bley over 4 years ago

Hey Matthias,

Yes I found at least the 1st and 2nd resource you mentioned. The first tells me how to migrate the database on the SAME machine (if I'm not mistaken) but I don't want to do that on the same machine if theres no other way.

The crux of the matter is that I want to leave the existing Openproject instance on server A as is and set up a new OP Instance on server B and then import the Database. 

That is because:
Server A is a production system and I cannot risk any data loss,
I do not have that much experiences with Databases,
I want to test the new instance on server B thoroughly before switching the production system from server A to server B.

greetings
Christian

RE: Migrating Openproject 8.3.2 with mySQL DBMS to new Server with newest OP version with PostgreSQL DBMS - Added by Max Mutzge over 4 years ago

Hey Christian,
have you thought about this way?: Create a databank dump, then you can migrate your data from MySQL to PostgreSQL using https://pgloader.io before uploading it on server B

Kind regards

RE: Migrating Openproject 8.3.2 with mySQL DBMS to new Server with newest OP version with PostgreSQL DBMS - Added by Christian Bley over 4 years ago

I'm trying to understand what PGLoader does. It seems like it just takes the data from the origin DBMS and puts into a new PostgreSQL DBMS without changing any of the data. Is that correct?

RE: Migrating Openproject 8.3.2 with mySQL DBMS to new Server with newest OP version with PostgreSQL DBMS - Added by Will Griffin over 4 years ago

Hi Christian,

You could run the migration script on the new server, as described in https://docs.openproject.org/installation-and-operations/misc/packaged-postgresql-migration/ but connect it over the network to the old mysql server instance.

You would need to open ports on any firewalls between the two machines to allow mysql traffic over the network, so check that mysql on the production server is bound to external interfaces and what port it is on:

sudo netstat -plunt

You would expect something like:

tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      2675/mysqld

... so mysql is listening on external interfaces on port 3306 as expects, so for example if the production machine was running ubuntu you might use ufw to open the port to allow traffic from your new server in on port 3306 (mysql):

sudo ufw allow 3306/tcp

You will also need to ensure that there is a suitable user on the production server mysql instance for the migration script on the new server to connect in as:

CREATE USER openproject@{newserveripaddress};
GRANT ALL PRIVILEGES ON openproject.* TO openproject@{newserveripaddress} IDENTIFIED BY '{password}';
FLUSH PRIVILEGES;

Then check you can access the production server mysql dqatabase from the new server:

mysql -u openproject -p -h {productionserveripaddess} -P 3306

Then edit the openproject config file on the new server so that the mysql conncetion string points at the production server and uses the credentials of the user you just created on it:

sudo openproject config:set MYSQL_DATABASE_URL="mysql2://openproject:{password}@{productionserveripaddress}:3306/openproject"

Then you can run the migration script, and it will connect over the network to your production mysql instance to get the data, but it will migrate it into the postgresql instance on your new server.

Good luck!

Will

RE: Migrating Openproject 8.3.2 with mySQL DBMS to new Server with newest OP version with PostgreSQL DBMS - Added by Sonia Allison about 4 years ago

Nice article thanks for sharing……  WalgreensListens

RE: Migrating Openproject 8.3.2 with mySQL DBMS to new Server with newest OP version with PostgreSQL DBMS - Added by Christian Bley almost 4 years ago

Thanks a lot Will

I followed your instructions and it seems to work but the migration script ended with:

Renaming to public schema
ERROR:  must be owner of schema public
ERROR:  must be owner of schema public
Failed to rename schema openproject to public. See above.

is that bad?

greets

RE: Migrating Openproject 8.3.2 with mySQL DBMS to new Server with newest OP version with PostgreSQL DBMS - Added by Will Griffin almost 4 years ago

Hi Christian

I don't know if that matters or not.  I would suggest you try logging into the web application and testing a few things.  If there are issues, then it may imply that you need to run the migration script as a postgresql user with sufficient permissions to be able to do that renaming, i.e. own the schema public.  If so, you could edit your postgresql config to allow suitable permissions (search for config options for pg_hba.conf to learn more on that).

Best wishes

Will

  • (1 - 10/10)
Loading...