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. Backup script fails

Backup script fails

Added by Tobias Braun over 6 years ago

Hello again ;-),

I try to create a backup to update from 8.1.0 to 8.2.0 and it fails to backup the mysql DB:

sudo openproject run backup
* Generating database backup...mysqldump: Got error: 1045: "Access denied for user 'root'@'localhost' (using password: YES)" when trying to connect
 done
/var/db/openproject/backup/mysql-dump-20190107182143.sql.gz
* Generating SVN repositories backup... done
/var/db/openproject/backup/svn-repositories-20190107182143.tar.gz
* No Git repositories folder. Ignoring.
* Generating attachments backup... done
/var/db/openproject/backup/attachments-20190107182143.tar.gz
* Saving configuration... done
/var/db/openproject/backup/conf-20190107182143.tar.gz

The configured user was used to migrate all the data from another system. A connection with HeidiSQL works fine. So it should basically work. I found an old bug ticket here. But this seems not my issue, when I check with 

openproject config:get DATABASE_URL

I get the stored URL to the mysql2 database:

mysql2://USER:PW@127.0.0.1:3306/openproject

KR,

Tobias


Replies (7)

RE: Backup script fails - Added by Oliver Günther over 6 years ago

Hi Tobias,

thanks for raising this issue. The backup script should simply take the value out of DATABASE_URL which you can check with openproject config:get DATABASE_URL. It will not use the root user unless that's specified in the database URL

The relevant section of the script can be found here.

https://github.com/opf/openproject/blob/v8.1.0/packaging/scripts/backup#L22-L47

Best,

Oliver

RE: Backup script fails - Added by Tobias Braun over 6 years ago

Hi Oliver,

the DATABASE_URL is configured and stored in the /etc/openproject/conf.d/database file. So this should be fine. You also send me a direct message about this topic, is there any way to fix the backup script manually for me? I would like to avoid to do it manually. I also want to use the script for daily backup.

Thanks,

Tobias

RE: Backup script fails - Added by Oliver Günther over 6 years ago

Hi Tobias,

I'll reach out via email.

Best,

Oliver

RE: Backup script fails - Added by Oliver Günther over 6 years ago

The actual issue is the password is being URL-encoded for use in DATABASE_URL , but is not unencoded in the backup script.

Bug ticket for tracking:

RE: Backup script fails - Added by Tobias Braun over 6 years ago

The error above comes when I used the escape string %40 instead of @ in the password. So escaping does not help. Using another password solved the problem. I copy this also to the bug.

RE: Backup script fails - Added by Oliver Günther over 6 years ago

Yes, exactly the escaped password will not work in the backup script, because the value needs to be decoded before passing to MySQL. I verified this error on my local installation and believe we're actually talking about the same problem :-)

Best,

Oliver

RE: Backup script fails - Added by Tobias Braun over 6 years ago

Ahh  you mean the escaping needs to be decoded again. Got it. Now it makes sense to me ;-).

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