Content
You are here:
Howto import and migrate 6.0.4 database in newly installed 7.3.2?
Added by Frank Michler about 7 years ago
Hi,
I am trying to migrate an OpenProject 6.0.4 to a newly installed OpenProject 7.3.2.
My question is:
How do I successfully import and migrate the old database to a new Debian 8 based OpenProject installation?
- The current system is running on OpenProject 6.0.4 (Ubuntu based Bitnami VM appliance)
- The new system is OpenProject 7.3.2, Debian 8, installed according to https://www.openproject.org/download-and-installation/#installation
- I have dumped the database using
mysqldump
- I made a copy of the files directory using
tar
Some more specific questions regarding the debian based installation are:
- How do I start/stop the openproject related services? In bitnami I would run for example
/opt/bitnami/ctlscript.sh stop
and/opt/bitnami/ctlscript.sh start mysql
. How is this done in debian 8?
-
I know in
/etc/init.d
are scripts to start and stop services. Which ones should I stop before I pump my dump.sql file in the new mysql database? Justapache2
andmemcached
?- How do I apply database migrations? In Bitnami installation I would run
cd /opt/bitnami/apps/openproject/htdocs ruby bin/rake db:migrate RAILS_ENV=production
- How would I do that in the debian instalation? I found the
/opt/openproject/bin
directory withruby
andrake
, but when I try to call it it gives me an error:
Any helpful hints are appreciated.
Thank you to to all who are improving OpenProject.
Frank Michler.
Replies (5)
Hi Frank,
generally, the packaged installer of OpenProject bundles ruby for the runuser
openproject
. Through the commandopenproject run
, you execute commands within that context.service openproject stop
(systemctl restart openproject for systemd)
All you ever need to do is run
openproject configure
to perform the first-time initialization, and on upgrades, to perform migrations and potential additional features.The configure step launches a wizard that runs you through the options the packaged installation has. In the first step, you can select an existing OpenProject bitnami MySQL database. Simply pass the existing user/dbname and the installer will re-use that database.
Of course you can also restore the dump on a fresh database and point the installer to that instead. By default, the wizard will create a new database
openproject
that it generates a password for.Best,
Oliver
Hi Oliver,
thank you for your quick response.
That’s good to know. Thanks.
I tried running
openproject reconfigure
and used the “reuse” option. But upon restart OpenProject wouldn’t start correctly. I get the following error:In the log obtained using
openproject logs
I see a fatal error regarding a missing tablerole_permissions
Is there a migration missing? Or did I do something wrong?
Can I add the missing table manually?
When comparing the automatically created database with the migrated one I can see this table missing.
edit:
Could this be related to this problem described on stackoverflow?
https://stackoverflow.com/questions/44701680/mysql2error-table-table-name-doesnt-exist-show-full-fields-from-table-na
Thanks again for your help.
Frank.
Ok. I solved the problem. It’s working now.
I was running the
openproject reconfigure
without internet access, and it tried to fetch something (maybe apt-get or so), failed, and aborted. Therefore the migrations were not applied. When I did it again with the VM connected to the internet it worked.My conclusion is: I always need to plug in internet access when I run
openproject reconfigure
. Is that correct? That would be good to know, since we want to run OpenProject in a separated network.Thanks again,
Frank.
One (hopefully last) problem: Where do I put the attachement files?
I copied them into the
/opt/openproject/files/
folder. But they don’t show up. When I try to access them I get theInternal error
again.And when I attach a new file it will not be placed in
/opt/openproject/files/
Has the attachement handling changed? Are they stored differently now?
That’s also solved now. For everybody else who might run into the same problem: attachement storage is configured in
/etc/openproject/conf.d/other
which exports environment variableATTACHEMENTS_STORAGE_PATH
Thanks again,
Frank.