diff --git a/doc/README.md b/doc/README.md index 5d89d0c9821ae3fb2fe33953a78e3d78ccac6a2a..f51069b2c30915959a5f3ce608c9d3075fc5bd27 100644 --- a/doc/README.md +++ b/doc/README.md @@ -7,6 +7,7 @@ - [GitLab as OAuth2 authentication service provider](integration/oauth_provider.md). It allows you to login to other applications from GitLab. - [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 and exporting projects between instances](workflow/import_export/README.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/import_export.md b/doc/workflow/import_export/README.md similarity index 85% rename from doc/administration/import_export.md rename to doc/workflow/import_export/README.md index 950899dc04b916ce5dfb29435cd62a746a1fa322..5349cca7172f44df436887f55906d202d83dc676 100644 --- a/doc/administration/import_export.md +++ b/doc/workflow/import_export/README.md @@ -1,7 +1,7 @@ # Project import/export Existing projects running on any GitLab instance or GitLab.com can be exported -with all its related data and be moved to a new GitLab instance. +with all its related data and be moved into a new GitLab instance. >**Note:** - This feature was [introduced][ce-3050] in GitLab 8.9 @@ -51,14 +51,14 @@ can be generated again ## Advanced -> The GitLab Import/Export version can be checked by using: +The GitLab Import/Export version can be checked by using: ```bash cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:import_export:version +sudo -u git -H 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: +The current list of DB tables that will get exported can be listed by using: ```bash cd /home/git/gitlab diff --git a/lib/tasks/gitlab/import_export.rake b/lib/tasks/gitlab/import_export.rake new file mode 100644 index 0000000000000000000000000000000000000000..c2c6031db670d269f9726ef1f1ca693d84a3b986 --- /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