Wednesday, October 31, 2018

Rocketchat backup and restore UBUNTU 18.04 SNAPS

This was taken from https://rocket.chat/docs/installation/manual-installation/ubuntu/snaps/


UBUNTU 18.04 using SNAPS
BACKUP ROCKET CHAT


1. Stop your rocketchat-server:

sudo service snap.rocketchat-server.rocketchat-server stop
2. Issue this backup command:
sudo snap run rocketchat-server.backupdb

3. If all goes well, you will see some output similar to:

[+] A backup of your data can be found at /var/snap/rocketchat-server/common/backups/rocketchat_backup_.tgz

4. Start your rocketchat-server:

sudo service snap.rocketchat-server.rocketchat-server start

UBUNTU 18.04 using SNAPS
RESTORE ROCKET CHAT

1. Stop your rocketchat-server:

sudo service snap.rocketchat-server.rocketchat-server stop
Please note: while the rocketchat-server service should be stopped, the rocketchat-mongo service should be kept running!
sudo service snap.rocketchat-server.rocketchat-mongo status | grep Active
   Active: active (running) (...)

2. Copy your backup file to the snap’s common folder:

sudo cp rocketchat_backup.tgz /var/snap/rocketchat-server/common/

3. Issue this restore command:

sudo snap run rocketchat-server.restoredb /var/snap/rocketchat-server/common/rocketchat_backup.tgz

4. If you are replacing an existing database, you will be warned:

*** ATTENTION ***
* Your current database WILL BE DROPPED prior to the restore!
* Would you like to make a backup of the current database before proceeding?
* (y/n/Q)>
  • Press y and Enter to make a backup of the database in its current state.
  • Press n and Enter to continue without a backup of the database in its current state.
  • Press any key and/or Enter to quit the restore process without making any changes.

5. If you choose to proceed and all goes well, you will see some output similar to:

[*] Extracting backup file...
[*] Restoring data...
[*] Preparing database...
[+] Restore completed! Please restart the snap.rocketchat services to verify.
If something goes wrong, you will instead be presented with a path to the relevant log file to help remedy errors. In this case, the database may not be usable until a restore is successfully performed.

6. Start your rocketchat-server:

sudo service snap.rocketchat-server.rocketchat-server start


No comments:

Post a Comment

Feel free to leave a comment! If you have any information that you think should be included, please do so here and I'll get it added in.