From 1b94f447d984aeb3f8475263be30e86c95d84af3 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Sun, 2 Aug 2020 12:35:55 +0200 Subject: [PATCH 1/7] adds documentation for importing existing repositories --- docs/en/faq.md | 4 ++++ docs/en/import.md | 52 ++++++++++++++++++++++++++++++++++++++++++ docs/en/navigation.yml | 1 + 3 files changed, 57 insertions(+) create mode 100644 docs/en/import.md diff --git a/docs/en/faq.md b/docs/en/faq.md index ef64b4d9db..1fc6cabe43 100644 --- a/docs/en/faq.md +++ b/docs/en/faq.md @@ -40,3 +40,7 @@ After changing the configuration, SCM-Manager must be restarted. ### How do I install plugins? Find the plugin you like to install at [plugins](/plugins#categories) and follow the installation instructions on the install page of the plugin. + +### How can i import my existing (git|mercurial|subversion) repository + +Please have a look on [this](../import/) detailed instructions. diff --git a/docs/en/import.md b/docs/en/import.md new file mode 100644 index 0000000000..ba334168fe --- /dev/null +++ b/docs/en/import.md @@ -0,0 +1,52 @@ +--- +title: Import existing repositories +subtitle: Howto import existing repositories into SCM-Manager +displayToc: true +--- + +## Git + +First you have to clone the old repository with the `mirror` option. +This option ensures that all branches and tags are fetched from the remote repository. +Assuming that your remote repository is accessible under the url `https://hgttg.com/r/git/heart-of-gold`, the clone command should look like this: + +```bash +git clone --mirror https://hgttg.com/r/git/heart-of-gold +``` + +Than you have to create your new repository via the SCM-Manager web interface and copy the url. +In this example we assume that the new repository is available at `https://hitchhiker.com/scm/repo/hgttg/heart-of-gold`. After the new repository is created, we can configure our local repository for the new location and push all refs. + +```bash +git remote set-url origin https://hitchhiker.com/scm/repo/hgttg/heart-of-gold +git push --mirror +``` + +## Mercurial + +To import an existing mercurial repository, we have to create a new repository over the SCM-Manager web interface, clone it, pull from the old repository and push to the new repository. +In this example we assume that the old repository is `https://hgttg.com/r/hg/heart-of-gold` and the newly created is located at `https://hitchhiker.com/scm/repo/hgttg/heart-of-gold`: + +```bash +hg clone https://hitchhiker.com/scm/repo/hgttg/heart-of-gold +hg pull https://hgttg.com/r/hg/heart-of-gold +hg push +``` + +## Subversion + +Subversion is not as easy as mercurial or git. +For subversion we have to locate the old repository on the filesystem and create a dump with the `svnadmin` tool. + +```bash +svnadmin dump /path/to/repo > oldrepo.dump +``` + +Now we have to create a new repository via the SCM-Manager web interface. +After the repository is created, we have to find its location on the filesystem. +This could be done by finding the directory with the newest timestamp in your scm home directory under `repositories`. +Now its time to import the dump from the old repository: + +```bash +svnadmin load /path/to/scm-home/repositories/id/data < oldrepo.dump +``` diff --git a/docs/en/navigation.yml b/docs/en/navigation.yml index e696c98bc6..9c30b03156 100644 --- a/docs/en/navigation.yml +++ b/docs/en/navigation.yml @@ -2,6 +2,7 @@ entries: - /installation/ - /migrate-scm-manager-from-v1/ + - /import/ - /faq/ - /known-issues/ From 3015419f32c86b1d26dc91ea43bfe6de812c50a1 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Mon, 3 Aug 2020 07:19:50 +0200 Subject: [PATCH 2/7] Update docs/en/faq.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: René Pfeuffer --- docs/en/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/faq.md b/docs/en/faq.md index 1fc6cabe43..762e7cff47 100644 --- a/docs/en/faq.md +++ b/docs/en/faq.md @@ -41,6 +41,6 @@ After changing the configuration, SCM-Manager must be restarted. Find the plugin you like to install at [plugins](/plugins#categories) and follow the installation instructions on the install page of the plugin. -### How can i import my existing (git|mercurial|subversion) repository +### How can I import my existing (git|mercurial|subversion) repository Please have a look on [this](../import/) detailed instructions. From 0177b53dc9bb9509d506649590166505e853a8ae Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Mon, 3 Aug 2020 07:20:12 +0200 Subject: [PATCH 3/7] Update docs/en/import.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: René Pfeuffer --- docs/en/import.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/import.md b/docs/en/import.md index ba334168fe..e5a11f4a6f 100644 --- a/docs/en/import.md +++ b/docs/en/import.md @@ -18,6 +18,7 @@ Than you have to create your new repository via the SCM-Manager web interface an In this example we assume that the new repository is available at `https://hitchhiker.com/scm/repo/hgttg/heart-of-gold`. After the new repository is created, we can configure our local repository for the new location and push all refs. ```bash +cd heart-of-gold git remote set-url origin https://hitchhiker.com/scm/repo/hgttg/heart-of-gold git push --mirror ``` From 045516791c1c6ad47f08633119deb5261c21243a Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Mon, 3 Aug 2020 07:20:22 +0200 Subject: [PATCH 4/7] Update docs/en/import.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: René Pfeuffer --- docs/en/import.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/import.md b/docs/en/import.md index e5a11f4a6f..5f2f38401a 100644 --- a/docs/en/import.md +++ b/docs/en/import.md @@ -46,6 +46,7 @@ svnadmin dump /path/to/repo > oldrepo.dump Now we have to create a new repository via the SCM-Manager web interface. After the repository is created, we have to find its location on the filesystem. This could be done by finding the directory with the newest timestamp in your scm home directory under `repositories`. +You can check whether you have found the correct directory by having a look at the file `metadata.xml`. Here you should find the namespace and the name of the repository created. Now its time to import the dump from the old repository: ```bash From c907df564f2c5e742fd99cecce5bd732e81feea5 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Mon, 3 Aug 2020 07:20:40 +0200 Subject: [PATCH 5/7] Update docs/en/import.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: René Pfeuffer --- docs/en/import.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/import.md b/docs/en/import.md index 5f2f38401a..f1076ef02f 100644 --- a/docs/en/import.md +++ b/docs/en/import.md @@ -30,6 +30,7 @@ In this example we assume that the old repository is `https://hgttg.com/r/hg/hea ```bash hg clone https://hitchhiker.com/scm/repo/hgttg/heart-of-gold +cd heart-of-gold hg pull https://hgttg.com/r/hg/heart-of-gold hg push ``` From e930884c55f025a3c273d5c999a76ec5ba29825f Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Mon, 3 Aug 2020 14:33:13 +0200 Subject: [PATCH 6/7] Update faq.md --- docs/en/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/faq.md b/docs/en/faq.md index 762e7cff47..64a8957395 100644 --- a/docs/en/faq.md +++ b/docs/en/faq.md @@ -43,4 +43,4 @@ Find the plugin you like to install at [plugins](/plugins#categories) and follow ### How can I import my existing (git|mercurial|subversion) repository -Please have a look on [this](../import/) detailed instructions. +Please have a look on [these](../import/) detailed instructions. From a552e54d20705cd3c29f5553d5676fe50f30b958 Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Mon, 3 Aug 2020 14:33:53 +0200 Subject: [PATCH 7/7] Update import.md --- docs/en/import.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/import.md b/docs/en/import.md index f1076ef02f..fd4d9e6d99 100644 --- a/docs/en/import.md +++ b/docs/en/import.md @@ -1,6 +1,6 @@ --- title: Import existing repositories -subtitle: Howto import existing repositories into SCM-Manager +subtitle: How to import existing repositories into SCM-Manager displayToc: true ---