diff --git a/doc/README.md b/doc/README.md index 3e7165d5ae4..f1283cea0ad 100644 --- a/doc/README.md +++ b/doc/README.md @@ -7,7 +7,8 @@ - [GitLab as OAuth2 authentication service provider](integration/oauth_provider.md). It allows you to login to other applications from GitLab. - [Container Registry](container_registry/README.md) Learn how to use GitLab Container Registry. - [GitLab Basics](gitlab-basics/README.md) Find step by step how to start working on your commandline and on GitLab. -- [Importing to GitLab](workflow/importing/README.md) +- [Importing to GitLab](workflow/importing/README.md). +- [Importing and exporting projects between instances](user/project/settings/import_export.md). - [Markdown](markdown/markdown.md) GitLab's advanced formatting system. - [Migrating from SVN](workflow/importing/migrating_from_svn.md) Convert a SVN repository to Git and GitLab. - [Permissions](permissions/permissions.md) Learn what each role in a project (external/guest/reporter/developer/master/owner) can do. diff --git a/doc/administration/raketasks/project_import_export.md b/doc/administration/raketasks/project_import_export.md new file mode 100644 index 00000000000..c212059b9d5 --- /dev/null +++ b/doc/administration/raketasks/project_import_export.md @@ -0,0 +1,33 @@ +# Project import/export + +>**Note:** + - This feature was [introduced][ce-3050] in GitLab 8.9 + - Importing will not be possible if the import instance version is lower + than that of the exporter. + - For existing installations, the project import option has to be enabled in + application settings (`/admin/application_settings`) under 'Import sources'. + - The exports are stored in a temporary [shared directory][tmp] and are deleted + every 24 hours by a specific worker. + +The GitLab Import/Export version can be checked by using: + +```bash +# Omnibus installations +sudo gitlab-rake gitlab:import_export:version + +# Installations from source +bundle exec rake gitlab:import_export:version RAILS_ENV=production +``` + +The current list of DB tables that will get exported can be listed by using: + +```bash +# Omnibus installations +sudo gitlab-rake gitlab:import_export:data + +# Installations from source +bundle exec rake gitlab:import_export:data RAILS_ENV=production +``` + +[ce-3050]: https://gitlab.com/gitlab-org/gitlab-ce/issues/3050 +[tmp]: ../../development/shared_files.md diff --git a/doc/user/project/settings/img/import_export_download_export.png b/doc/user/project/settings/img/import_export_download_export.png new file mode 100644 index 00000000000..a2f7f0085c1 Binary files /dev/null and b/doc/user/project/settings/img/import_export_download_export.png differ diff --git a/doc/user/project/settings/img/import_export_export_button.png b/doc/user/project/settings/img/import_export_export_button.png new file mode 100644 index 00000000000..1f7bdd21b0d Binary files /dev/null and b/doc/user/project/settings/img/import_export_export_button.png differ diff --git a/doc/user/project/settings/img/import_export_mail_link.png b/doc/user/project/settings/img/import_export_mail_link.png new file mode 100644 index 00000000000..c123f83eb8e Binary files /dev/null and b/doc/user/project/settings/img/import_export_mail_link.png differ diff --git a/doc/user/project/settings/img/import_export_new_project.png b/doc/user/project/settings/img/import_export_new_project.png new file mode 100644 index 00000000000..b3a7f201018 Binary files /dev/null and b/doc/user/project/settings/img/import_export_new_project.png differ diff --git a/doc/user/project/settings/img/import_export_select_file.png b/doc/user/project/settings/img/import_export_select_file.png new file mode 100644 index 00000000000..f31832af3e1 Binary files /dev/null and b/doc/user/project/settings/img/import_export_select_file.png differ diff --git a/doc/user/project/settings/img/settings_edit_button.png b/doc/user/project/settings/img/settings_edit_button.png new file mode 100644 index 00000000000..3c0cee536de Binary files /dev/null and b/doc/user/project/settings/img/settings_edit_button.png differ diff --git a/doc/user/project/settings/import_export.md b/doc/user/project/settings/import_export.md new file mode 100644 index 00000000000..38e9786123d --- /dev/null +++ b/doc/user/project/settings/import_export.md @@ -0,0 +1,73 @@ +# Project import/export + +>**Notes:** + - This feature was [introduced][ce-3050] in GitLab 8.9 + - Importing will not be possible if the import instance version is lower + than that of the exporter. + - For existing installations, the project import option has to be enabled in + application settings (`/admin/application_settings`) under 'Import sources'. + Ask your administrator if you don't see the **GitLab export** button when + creating a new project. + - You can find some useful raketasks if you are an administrator in the + [import_export](../../../administration/raketasks/project_import_export.md) + raketask. + - The exports are stored in a temporary [shared directory][tmp] and are deleted + every 24 hours by a specific worker. + +Existing projects running on any GitLab instance or GitLab.com can be exported +with all their related data and be moved into a new GitLab instance. + +## Exported contents + +The following items will be exported: + +- Project and wiki repositories +- Project uploads +- Project configuration including web hooks and services +- Issues with comments, merge requests with diffs and comments, labels, milestones, snippets, + and other project entities + +The following items will NOT be exported: + +- Build traces and artifacts +- LFS objects + +## Exporting a project and its data + +1. Go to the project settings page by clicking on **Edit Project**: + + ![Project settings button](img/settings_edit_button.png) + +1. Scroll down to find the **Export project** button: + + ![Export button](img/import_export_export_button.png) + +1. Once the export is generated, you should receive an e-mail with a link to + download the file: + + ![Email download link](img/import_export_mail_link.png) + +1. Alternatively, you can come back to the project settings and download the + file from there, or generate a new export. Once the file available, the page + should show the **Download export** button: + + ![Download export](img/import_export_download_export.png) + +## Importing the project + +1. The new GitLab project import feature is at the far right of the import + options when creating a New Project. Make sure you are in the right namespace + and you have entered a project name. Click on **GitLab export**: + + ![New project](img/import_export_new_project.png) + +1. You can see where the project will be imported to. You can now select file + exported previously: + + ![Select file](img/import_export_select_file.png) + +1. Click on **Import project** to begin importing. Your newly imported project + page will appear soon. + +[ce-3050]: https://gitlab.com/gitlab-org/gitlab-ce/issues/3050 +[tmp]: ../../../development/shared_files.md diff --git a/lib/tasks/gitlab/import_export.rake b/lib/tasks/gitlab/import_export.rake new file mode 100644 index 00000000000..c2c6031db67 --- /dev/null +++ b/lib/tasks/gitlab/import_export.rake @@ -0,0 +1,13 @@ +namespace :gitlab do + namespace :import_export do + desc "GitLab | Show Import/Export version" + task version: :environment do + puts "Import/Export v#{Gitlab::ImportExport.version}" + end + + desc "GitLab | Display exported DB structure" + task data: :environment do + puts YAML.load_file(Gitlab::ImportExport.config_file)['project_tree'].to_yaml(:SortKeys => true) + end + end +end