Root-Server Tutorial

ROOT-SERVER TUTORIAL

Back up & Restore Your Uptime Kuma Instance

Learn how to back up and restore your Uptime Kuma instance.

Introduction

This tutorial is a follow-up of the tutorial Setup of Uptime Kuma Standalone on Ubuntu with a Reverse Proxy.

This tutorial describes how to back up your Uptime Kuma instance and restore it, if needed.

The time required for this tutorial is about 3-5 minutes.

Requirements

You need a running Uptime Kuma instance that does not use the Docker setup.

Step 1 - Backup

  1. Log in to your server via SSH.
  2. Enter sudo -s to get root permissions.
  3. Enter your password and press Enter.
  4. Install the package zip (along with unzip) with apt install -y zip unzip.
  5. If a pink window appears, press Enter once to continue.
  6. Stop the Uptime Kuma service with systemctl stop uptime-kuma.
  7. Enter exit to leave the root shell.
  8. Enter zip -r uptimekuma-backup.zip ./uptime-kuma/data to create a backup of your Uptime Kuma data.
  9. Restart the Uptime Kuma service with sudo systemctl start uptime-kuma.
  10. Enter exit to leave the SSH session.

Now you have a backup of your Uptime Kuma data in the file uptimekuma-backup.zip in the home directory of the user you used to log in to your server.

Step 2 - Restoring a backup

Warning: If you carry out the steps below, your current Uptime Kuma data will be overwritten!

For using this tutorial the backup file needs to be stored in the user's home directory. If it is not there, you can upload it with scp or sftp to your server.

If it is just the database that is broken, you can restore it easily. If the entire Uptime Kuma instance is broken, you need to delete the current instance first and then restore the backup. For this purpose, you must delete the current instance using the command rm -r uptime-kuma and then reinstall it by following Step 4 of the installation tutorial.

  1. Log in to your server via SSH.
  2. Enter sudo systemctl stop uptime-kuma to get root permissions.
  3. Enter your password and press Enter.
  4. Enter rm -r uptime-kuma/data to delete the current Uptime Kuma data.
  5. Move the backup to the correct location with mv uptimekuma-backup.zip uptime-kuma && cd uptime-kuma.
  6. Enter unzip uptimekuma-backup.zip to restore the backup.
  7. Enter sudo systemctl start uptime-kuma to start the Uptime Kuma service.

Conclusion

Now you know how to back up and restore your Uptime Kuma instance.

Thank you for reading this tutorial.

License

MIT

Copyright (c) 2023 Konstantin Protzen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contributor's Certificate of Origin

By making a contribution to this project, I certify that:

  1. The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or

  2. The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or

  3. The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

  4. I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved.

Published 16/08/2023 by Konstantin Protzen

Submit your tutorial

Get 60€ netcup vouchers for every published tutorial.