-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backup Restore option in Settings under Administrator #758
Comments
👍 @Megatronic79 is transforming Rocket.Chat into an Enterprise grade platform - one feature at a time. |
haha - loving the product guys |
This will probably be pretty easy when @geekgonecrazy gets finished with his import-framework branch. 😄 |
Nice |
Related to #746 - download history |
Isn't this also related with #332 and #992 ? at least the "restore option" I know they are different. This is an "import" option for the proper rocketchat backup, but it could be all the same process. An import / export wrapper and libraries to export / import to different formats (rocket chat itself, slack, hipchat and so on). For example, in my work we're currently using hipchat and having an "import from hipchat" option would make us change from hipchat to rocketchat without thinking in it. |
@elboletaire Yes, there has been some work on an import framework which will allow people to create imports for any other chat service out there. Slack one is in progress and I agree that the export should be similar for Rocket.Chat. |
nice! I shall be attentive to it 😄 |
I am also wanting this feature. |
almost a year, still don't have progress? |
@9cat we haven't gotten to this yet. We have some other key things we need to take care of first. But... Since Rocket.Chat is self hosted, you can back up the database at absolutely any time you want via mongo. |
It's very easy to script the backup and schedule via mongodump. |
This is my script I run from crontab once per hour backup.sh daten=$(date +%y%m%d%H%M) |
How can I get that to work when my mongodb is inside of a docker-compose container @lunitic ? |
@wargamesqcf something like this.. Haven't tested this, but I think will work. |
its not rocketchat_mongo_1:db its whatever your username is _mongo_1:db Now the question comes how do I restore the backup |
@wargamesqcf yeah actually I think its dependent on the name of the folder you have the docker-compose file in. I personally put mine in a folder |
yep that probably what is happening, but you should output something to /backups folder in linux right? |
@wargamesqcf that command would run inside the container and put the backup inside of the /backup folder inside the container. That folder is mounted to your file system to |
That worked! now how do we reserves this if/when the mongodb crashes and dies? docker run -it --link foldername_mongo_1:db -v /backups:/backups mongo mongodump -h db -o /backups/test |
I use this to backup the db with a cron job every night #!/bin/bash
set -ex
APP_NAME="rocketchat"
TIMESTAMP=`date +%F-%H%M`
BACKUP_DIR="/var/backups/mongo"
BACKUP_PATH="$BACKUP_DIR/$APP_NAME$TIMESTAMP.tgz"
docker exec mongo mongodump --archive=/dump/archive.json
7z a -t7z -mx=4 -mfb=64 -md=32m -ms=on $BACKUP_PATH /opt/rocketchat/data/dump/archive.json
# copy over the file at $BACKUP_PATH to remote server here Then to restore it simply docker exec -it mongo mongorestore --gzip --archive=data/archive.json This is assuming you placed the archive.json in /opt/rocketchat/data/dump/ (which is linked to the container's /data/dump folder) On the subject of this issue, I don't think it is relevant to build this into the core. Backup and restore should be done on the server itself, not by the application in my opinion. |
For me I have the docker-compose.yml in a home directory, and would just leave out the var in backup dir, that shouldn't really mess with the mongorestore right? having the application handle the backup/restore is nice because most of those are easier for the end user. |
Doesn't matter where you docker-compose file is located really. And sure, place the backups wherever you want. I'd recommend copying them over to a remote server as well in the same script. |
100% agree, shove them into a google drive. |
I used your bash and got this as an outpout 016-09-19T18:53:27.715+0000 Failed: open /backups/mongo/archive.json: no such file or directory
|
@wargamesqcf you would have had to mounted that as a directory when you started the mongo container. This is why I suggested the additional container approach 😄 This way it mounts that directory executes and then closes. |
I have a fundamental lack of docker knowledge. |
@geekgonecrazy so this works on backing up the mongodb that is in a docker-compose
Would this work to restore the back up files?
|
I've made a small script to export / import / sync Rocket.Chat configurations between two different instances on the same machine: https://github.com/paladini/Rocket.Chat.Export.Settings I'm no longer using Rocket.Chat, but have developed this a month ago, so it's working fine. Hope that it can help someone or at least that someone can extend this piece of software to suit it's own needs. |
Is this still missing within Rocket Chat? Need to move servers and trying to export from Rocket.Chat. |
Yes, @dmkjr, it is still not implemented (unfortunately). |
I'm trying to move a RocketChat instance running with docker compose from one server to another. |
I am running into the same issue of private chats and groups not restoring properly. Am I doing something wrong? Using dump only makes sense if it provides us with a fully working backup. |
Having control over your data is a pretty big thing for open source solutions. I've seen people mention that in academics it's common for a whole team to move, so they need a way to take that history with them. The scripts to backup the mongodb are certainly a step in the right direction, both for teams moving and to simply have a backup mechanism. I am well aware I'm not paying for this, and I could be working on a pull request instead of posting here. But I wanted to be another voice supporting this issue. |
really don't see the point of having something built in to the web interface to do this. mongodb has full support for proper backups, and it's the database, not the application which is important here. Its the same with lots of enterprise apps as well that don't have a "backup interface" - you dump the database directly, not through any way in the actual application it self. Just another unnecessary layer of complication. Sorry don't meant to be rude but, if you are not capable of running a single command to do a full Mongo backup, and another single command for restore - you probably shouldn't be running something like this in production. the app (RocketChat instance) should be considered disposable. it's not important, absolutely everything that is needed end to end to bring up another instance is inside the database. you are simply pointing it at your mongo instance, nothing special. why have the data travel through another layer instead of taking it directly from the source. it's the only way to ensure 100% that things are done properly |
I want! |
Actually, A good mainstream example to expand on the above -
|
@maxpen > I want! Backup: Restore: |
In response to the discussion above, I was also looking for a feature like this. One point that hasn't been brought up is that I have 2 running, working instances of rocket.chat and want to compare the configs. No, I've not yet dumped mongodb but for the same reason I don't want to compare 2 SQL dumps for diffing the config of two applications in this case I'd love to have something in the admin GUI. It's not only about backup and restore. |
That would go in feature requests, not here. https://github.com/RocketChat/feature-requests However, before you open one, consider how one Rocket GUI is going to diff options with another version? That's pretty complex and not really what Rocket is about. You probably ought to look at using a proper Mongo DB tool outside of Rocket. Or asking for a Utility to dump JUST the configurations (so you can compare with your diff tool), and not all the data. |
@reetp I think it's debatable if it's a feature request (I wouldn't open one for this) or if it's just "I could (ab)use this feature for other uses" depending how nitpicky you are ;) Just to clarify my point: Nearly all important config data is in mongo and so it's not easily machine readable by someone who doesn't want to dig deep into the application (for example someone who just wants to run a server and put some config into a config management tool like ansible). I guess I can just do some 20 liner script that diffs the But I'll shut up now because I'm not married to this GUI export feature and am happy with |
Backup \ export \ import options in Administrator settings page to\from tar file that can be used to re-deploy to another server with all data (including channel data)
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: