@@ -5,10 +5,35 @@ info: To determine the technical writer assigned to the Stage/Group associated w
type:reference
---
# Moving repositories managed by GitLab
# Moving repositories managed by GitLab **(CORE ONLY)**
Sometimes you need to move all repositories managed by GitLab to
another file system or another server. In this document we look
another file system or another server.
## Moving data within a GitLab instance
The recommended way to move Git repositories between servers, between different storage, and
from unclustered to clustered Gitaly (Praefect) is using the API.
Read more:
-[Configuring additional storage for Gitaly](../gitaly/index.md#network-architecture)
- Within this example, additional storage called `storage1` and `storage2` is configured.
-[The API documentation](../../api/project_repository_storage_moves.md) details the endpoints for quering and scheduling repository moves.
-[Migrate existing repositories to Gitaly Cluster](../gitaly/praefect.md#migrate-existing-repositories-to-gitaly-cluster)
### Limitations
Read more in the [API documentation](../../api/project_repository_storage_moves.md#limitations).
## Migrating to another GitLab instance
Using the API isn't an option if you are migrating to a new GitLab environment, for example:
- From a single-node GitLab to a scaled-out architecture.
- From a GitLab instance in your private datacenter to a cloud provider.
The rest of the document will look
at some of the ways you can copy all your repositories from
`/var/opt/gitlab/git-data/repositories` to `/mnt/gitlab/repositories`.
...
...
@@ -22,7 +47,14 @@ DANGER: **Warning:**
Each of the approaches we list can or does overwrite data in the target directory
`/mnt/gitlab/repositories`. Do not mix up the source and the target.
## Target directory is empty: use a `tar` pipe
### Recommended approach in all cases
GitLab's [backup and restore capability](../../raketasks/backup_restore.md) should be used. Git repositories are accessed, managed and stored on GitLab servers by the Gitaly component of the product as a database. Data loss can result from directly accessing and copying Gitaly's files using tools like `rsync`.
- From GitLab 13.3, backup performance can be improved by [processing multiple repositories concurrently](../../raketasks/backup_restore.md#back-up-git-repositories-concurrently).
- Backups can be created of just the repositories using the [skip feature](../../raketasks/backup_restore.md#excluding-specific-directories-from-the-backup)
### Target directory is empty: use a `tar` pipe
If the target directory `/mnt/gitlab/repositories` is empty the
simplest thing to do is to use a `tar` pipe. This method has low