Content
You are here:
Backup/Restore procedure
Added by I. V. over 10 years ago
What is the proper backup/restore procedure for OP?
According to the following link: https://www.openproject.org/projects/openproject/wiki/Migration_24_to_30
OpenProject has data in these places: * Database (see config/database.yml to find out which one is used) * openproject directory Attachments are stored by default in openproject/files, in this case no separate backup is necessary. If configured to be stored elsewhere check config/configuration.yml for attachments_storage_path and backup the files stored there. * Repositories: If you're using repositories via reposman.rb, you should back them up. There's no standard path for them, you can find their path in the cron job running the script or in the individual project settings.
So, I guess, installing the ruby and other requrements/dependencies and then restoring the previosly made backup would be enough to have OP running on the newly installed server.
What is your backup/restore strategy?
Regards,
Igor
Replies (8)
I’d really love a backup and restore procedure for 4.0.X. I’ve got what I believe is a backup of everything important, but I have no idea how to restore it.
From what I can tell, no one ever considered backups during the development of OpenProject.
I’ve been searching high and low for an existing backup procedure that will work, and haven’t found anything useful. It’s incredibly annoying that backup is nothing but an afterthought on this project.
I’m afraid I’ll have to write my own set of backup and restore scripts, but maintenance could be a real pain, since we want to be able to upgrade when new versions of OP come available.
This should be escalated with a high priority!
Backups are very important and I would love to get a working method, too…
I guess I have to get a faster server and we already configurated stuff and more and I would like to take everything over to the new server… This must be possible!
I totally agree… you really don’t want 10+ workers out of sync because “there was no recent backup”. I’d which to see a scheduler to manage .xml dumps to a remote FTP server or something like that. Getting email-updates in case anything is not working properly is also a must. Deleting backups older than x would be a nice addition.
Anyhow, thx a lot for the great work on OpenProject. Very nice job! But please fix this..
Hi,
first of all thank you for your feedback. I have the feeling that the issue is not the missing backup solution but rather the missing documentation of it.
To discuss what Mike mentioned:
openproject-ce run backup
oropenproject run backup
if you use only the core version.Ok so far so good. As you can see the whole backup issue is something the community already thought about. Of course there are still things which have to be improved. But we can’t do it all at once and we can’t do it alone. So please help us to get things better.
@Mike: You mentioned that the rake task isn’t working correct?! Can you be more precise on that? If t is not working it is a bug and it will be fixed. Before you consider writing your own backup scripts please consider creating a Pull Request and change the rake task in the way you want it to work. OpenProject is open source. So we all can benefit from each other.
@all: If you are new to the Linux world and do not want to setup the rails stack by yourself please consider to use the packaged solution. This makes updates of OpenProject a lot easier. Ruby and stuff will be updated too. Setting everything up by yourself should only a option if you know exactly what you are doing. Unfortunately there are a lot of evil pitfalls.
Short notice on what has to be backed up:
These three backups including the OpenProject code which is available at github should be all you need to restore your application.
Please if you have any further questions or remarks do not hesitate to comment on this post.
Cheers,
Karsten
Okay, perhaps I looked at it the wrong way, then. The issue apparently isn’t with this issue being ignored, but rather with it being misunderstood.
First, I’ll respond to this:
I didn’t go into detail about this, because I made this determination by finding other existing bug reports in the OpenProject work issues.
Now, to this:
Being new to Ruby is far different from being new to Linux. I, for example, deployed my first Apache web server and qmail mail server (it was popular back then) for a corporation back in the year 2000. I really have no idea how many Linux servers of various types I’ve deployed in the almost 15 years since then (it was around July of 2000, iirc). But Ruby is still a relative new comer to me. The attitude that Ruby = Linux/“The Linux World” is mistake number 1. If Ruby were an important part of Linux, it would be on the exam requirements the Linux Foundation Certified Engineer cert (http://training.linuxfoundation.org/certification/lfce).
Mistake number 2 is thinking that people actually want to run backup jobs manually. The script, as described, was obviously designed to be run manually. In a typical server deployment, the backup jobs need to be automated. Configuration files can be backed up manually, but the database, attachments, and SVN repos (if needed) should all be backed up automatically on a daily basis (at least incrementally, with full backups every weekend). The script does not accomodate this need.
Mistake number 3 is assuming the use of Ruby for automating this task on my end. I don’t know Ruby, and have no interest in learning it. I know bash, C, C, php, javascript, html, Verilog, VHDL, and various forms of BASIC. Out of these, the obvious choice for a backup script is bash. So if I have to do it myself, it will be written in bash. I wrote a quick and dirty bash script for this already, just to get something working. I really don’t have the time right now to write a good one; I simply have too many things on my plate.
To me, it looks like the programmers writing this don’t have any real world admin experience, and that’s why they missed the boat on backups. If you listen to experienced admins, though, you can make sure your backup system accommodates the way we run backups.
Aside from daily incrementals and weekly full backups, the number of files kept needs to have definable limits. Of course, the destinations for the backup files need to be configurable as well. One should be able to configure, for example:
Max_Incrementals_Kept = 5
Full_Backups_Frequency = weekly
Max_Weekly_Backups_Kept = 4
Max_Monthly_Backups_Keyp = 6
Timestamp_Format = ‘%M*%d*%Y-%H:%m:%s’ # For the backup file naming
Destination_Directory = /srv/backups
Destination_is_NFS_Mount = true # so it can make sure the NFS mount is good before putting files there
Destination_Alternate_Directory = /srv/local_backups # In case the primary destination is unusable
Notify_email = admin@openproject.org # Whom to e-mail for failures/successes
Notify_on_success = false
Notify_on_fail = true
These are, pretty much, the minimum options needed for a good automated backup system. The time of day/DoW for the backups could be set by the cronjob used to run it, or it could be part of the script (if it has a reliable daemon to run the backup jobs).
“There is a rake task available to backup the database. Everything else (svn repositories and attachment files) has to be backed up individually.”
Sweet.
But how does one restore from it?
I’m 99% certain I have a complete backup. I’ve used that rake task and bundled up the output with the other directories listed and I’m keeping an archive of them. But as sane backups go, it isn’t a backup until I’ve tested it. And I’ve tried to find any description of how to use the output of that rake task and I can’t find it. My own intuitive attempts to use it have all failed at getting a working openproject instance. Could we have some guidance?
Also some of us are using manual installs because that was the only option available when we did our install. Migration from there to packages would be awesome.
Has anyone managed to automate this rake backup funktion? Or does anyone know of an open source script that just backups my whole disk to an externa location? I am that typical “project administrator” that you discribed earlyer. I’m expert in managing peojects, not in writing scripts. I understand what you are talking about, and have managed to install openproject on a VPS. But I realy would have no idea at all where to start conserning scheduled backups. I allready would be happy if the database is mailed to my email adress… It sounds like I don’t give a f*ck how, as long as i have a back up… Wel I do value qualitative software, but for me to test this software (which i am boing atm) I need real people working with the software in a real context, also to be able to give you feedback.. But the idea of losing everything in cas of… makes me want to fall back on dirty methods, suggestions pleas?