You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

backup-and-restore.en-us.md 1.8 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ---
  2. date: "2017-01-01T16:00:00+02:00"
  3. title: "Usage: Backup and Restore"
  4. slug: "backup-and-restore"
  5. weight: 11
  6. toc: true
  7. draft: false
  8. menu:
  9. sidebar:
  10. parent: "usage"
  11. name: "Backup and Restore"
  12. weight: 11
  13. identifier: "backup-and-restore"
  14. ---
  15. # Backup and Restore
  16. Gitea currently has a `dump` command that will save your installation to a zip file. There will be a `restore` command implemented at some point in the future. You will be able to use this to back up your installation, as well as make migrating servers easier.
  17. ## Backup Command (`dump`)
  18. First, switch to the user running gitea: `su git` (or whatever user you are using). Run `./gitea dump` in the gitea installation directory. You should see some output similar to this:
  19. ```
  20. 2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001
  21. 2016/12/27 22:32:09 Dumping local repositories.../home/git/gitea-repositories
  22. 2016/12/27 22:32:22 Dumping database...
  23. 2016/12/27 22:32:22 Packing dump files...
  24. 2016/12/27 22:32:34 Removing tmp work dir: /tmp/gitea-dump-417443001
  25. 2016/12/27 22:32:34 Finish dumping in file gitea-dump-1482906742.zip
  26. ```
  27. Inside the `gitea-dump-1482906742.zip` file, you will find the following:
  28. * `custom/conf/app.ini` - This is your server config.
  29. * `gitea-db.sql` - SQL dump of your database.
  30. * `gitea-repo.zip` - This zip will be a complete copy of your repo folder.
  31. See Config -> repository -> `ROOT` for the location.
  32. * `log/` - this will contain various logs. You don't need these if you are doing
  33. a migration.
  34. Intermediate backup files are created in a temporary directory specified either with the `--tempdir` command-line parameter or the `TMPDIR` environment variable.
  35. ## Restore Command (`restore`)
  36. WIP: Does not exist yet.