2020-10-23 20:08:35 -04:00
---
2022-05-29 20:08:35 -04:00
stage: Systems
2020-12-01 13:09:42 -05:00
group: Distribution
2022-09-21 17:13:33 -04:00
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
2020-10-23 20:08:35 -04:00
---
2021-01-28 01:08:59 -05:00
# Project import/export administration **(FREE SELF)**
2016-06-21 14:07:52 -04:00
2020-04-27 02:09:51 -04:00
GitLab provides Rake tasks relating to project import and export. For more information, see:
2020-01-31 04:08:53 -05:00
- [Project import/export documentation ](../../user/project/settings/import_export.md ).
- [Project import/export API ](../../api/project_import_export.md ).
2020-06-17 14:09:08 -04:00
- [Developer documentation: project import/export ](../../development/import_export.md )
## Project import status
You can query an import through the [Project import/export API ](../../api/project_import_export.md#import-status ).
As described in the API documentation, the query may return an import error or exceptions.
2022-08-02 23:09:00 -04:00
## Import/export Rake tasks
2020-04-27 02:09:51 -04:00
2020-01-31 04:08:53 -05:00
The GitLab import/export version can be checked by using the following command:
2016-06-21 14:07:52 -04:00
2020-01-30 10:09:15 -05:00
```shell
2016-06-21 14:07:52 -04:00
# Omnibus installations
sudo gitlab-rake gitlab:import_export:version
# Installations from source
bundle exec rake gitlab:import_export:version RAILS_ENV=production
```
2020-11-19 16:09:07 -05:00
The current list of DB tables to export can be listed by using the following command:
2016-06-21 14:07:52 -04:00
2020-01-30 10:09:15 -05:00
```shell
2016-06-21 14:07:52 -04:00
# Omnibus installations
sudo gitlab-rake gitlab:import_export:data
# Installations from source
bundle exec rake gitlab:import_export:data RAILS_ENV=production
```
2020-01-31 04:08:53 -05:00
Note the following:
2020-02-10 22:09:13 -05:00
- Importing is only possible if the version of the import and export GitLab instances are
compatible as described in the [Version history ](../../user/project/settings/import_export.md#version-history ).
2021-06-18 11:10:16 -04:00
- The project import option must be enabled:
2022-09-14 14:12:48 -04:00
1. On the top bar, select **Main menu > Admin** .
2021-06-18 11:10:16 -04:00
1. On the left sidebar, select **Settings > General** .
1. Expand **Visibility and access controls** .
1. Under **Import sources** , check the "Project export enabled" option.
1. Select **Save changes** .
2021-05-17 17:10:42 -04:00
- The exports are stored in a temporary directory and are deleted every
24 hours by a specific worker.
2022-08-02 23:09:00 -04:00
### Import large projects using a Rake task
If you have a larger project, consider using a Rake task as described in our [developer documentation ](../../development/import_project.md#importing-via-a-rake-task ).
### Export using a Rake task
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25598) in GitLab 12.9.
You can use a Rake task to export large project.
Parameters:
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `username` | string | yes | User name |
| `namespace_path` | string | yes | Namespace path |
| `project_path` | string | yes | Project name |
| `archive_path` | string | yes | Path to file to store the export project tarball |
```shell
gitlab-rake "gitlab:import_export:export[username, namespace_path, project_path, archive_path]"
```
## Troubleshooting
If you are having trouble with import/export, you can enable debug mode using the same Rake task:
```shell
# Import
IMPORT_DEBUG=true gitlab-rake "gitlab:import_export:import[root, group/subgroup, testingprojectimport, /path/to/file_to_import.tar.gz]"
# Export
EXPORT_DEBUG=true gitlab-rake "gitlab:import_export:export[root, group/subgroup, projectnametoexport, /tmp/export_file.tar.gz]"
```