Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5c306b2f
Commit
5c306b2f
authored
Oct 28, 2021
by
Tim Poffenbarger
Committed by
Nick Gaskill
Oct 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document a second option for importing
parent
c17e7fad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
5 deletions
+60
-5
doc/user/project/settings/import_export.md
doc/user/project/settings/import_export.md
+60
-5
No files found.
doc/user/project/settings/import_export.md
View file @
5c306b2f
...
...
@@ -235,13 +235,16 @@ Review [issue 276930](https://gitlab.com/gitlab-org/gitlab/-/issues/276930), and
-
Ensure shared runners are enabled in both the source and destination projects.
-
Disable shared runners on the parent group when you import the project.
### Import workaround for large repositories
### Import workaround
s
for large repositories
[
Maximum import size limitations
](
#import-the-project
)
can prevent an import from being successful.
If changing the import limits is not possible,
the following local workflow can be used to temporarily
reduce the repository size for another import attempt.
can prevent an import from being successful. If changing the import limits is not possible, you can
try one of the workarounds listed here.
#### Workaround option 1
The following local workflow can be used to temporarily
reduce the repository size for another import attempt:
1.
Create a temporary working directory from the export:
...
...
@@ -291,6 +294,58 @@ reduce the repository size for another import attempt.
delete the temporary,
`smaller-tmp-main`
branch, and
the local, temporary data.
#### Workaround option 2
Rather than attempting to push all changes at once, this workaround:
-
Separates the project import from the Git Repository import
-
Incrementally pushes the repository to GitLab
1.
Make a local clone of the repository to migrate. In a later step, you push this clone outside of
the project export.
1.
Download the export and remove the
`project.bundle`
(which contains the Git repository):
```
shell
tar
-czvf
new_export.tar.gz
--exclude
=
'project.bundle'
@old_export.tar.gz
```
1.
Import the export without a Git repository. It asks you to confirm to import without a
repository.
1.
Save this bash script as a file and run it after adding the appropriate origin.
```
shell
#!/bin/sh
# ASSUMPTIONS:
# - The GitLab location is "origin"
# - The default branch is "main"
# - This will attempt to push in chunks of 500MB (dividing the total size by 500MB).
# Decrease this size to push in smaller chunks if you still receive timeouts.
git gc
SIZE
=
$(
git count-objects
-v
2> /dev/null |
grep
size-pack |
awk
'{print $2}'
)
# Be conservative... and try to push 2GB at a time
# (given this assumes each commit is the same size - which is wrong)
BATCHES
=
$((
$SIZE
/
500000
))
TOTAL_COMMITS
=
$(
git rev-list
--count
HEAD
)
if
((
BATCHES
>
TOTAL_COMMITS
))
;
then
BATCHES
=
$TOTAL_COMMITS
fi
INCREMENTS
=
$((
(
$TOTAL_COMMITS
/
$BATCHES
)
-
1
))
for
((
BATCH
=
BATCHES
;
BATCH>
=
1
;
BATCH--
))
do
COMMIT_NUM
=
$((
$BATCH
-
$INCREMENTS
))
COMMIT_SHA
=
$(
git log
-n
$COMMIT_NUM
--format
=
format:%H |
tail
-1
)
git push
-u
origin
${
COMMIT_SHA
}
:refs/heads/main
done
git push
-u
origin main
git push
-u
origin -—all
git push
-u
origin -—tags
```
### Manually execute export steps
Exports sometimes fail without giving enough information to troubleshoot. In these cases, it can be
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment