Repository Storage Rake Tasks

This is a collection of rake tasks you can use to help you list and migrate existing projects and attachments associated with it from Legacy storage to the new Hashed storage type.

You can read more about the storage typeshere.

Migrate existing projects to Hashed storage

Before migrating your existing projects, you shouldenable hashed storagefor the new projects as well.

This task will schedule all your existing projects and attachments associated with it to be migrated to theHashedstorage type:

Omnibus Installation

gitlab-rake gitlab:storage:migrate_to_hashed

Source Installation

rake gitlab: storage:migrate_to_hashed

You can monitor the progress in theAdmin > Monitoring > Background jobsscreen. There is a specific Queue you can watch to see how long it will take to finish:project_migrate_hashed_storage

After it reaches zero, you can confirm every project has been migrated by running the commands bellow. If you find it necessary, you can run this migration script again to schedule missing projects.

Any error or warning will be logged in the sidekiq's log file.

You only need thegitlab:storage:migrate_to_hashedrake task to migrate your repositories, but we have additional commands below that helps you inspect projects and attachments in both legacy and hashed storage.

List projects on Legacy storage

To have a simple summary of projects usingLegacystorage:

Omnibus Installation

gitlab-rake gitlab:storage:legacy_projects

Source Installation

rake gitlab: storage:legacy_projects

To list projects usingLegacystorage:

Omnibus Installation

gitlab-rake gitlab:storage:list_legacy_projects

Source Installation

rake gitlab: storage:list_legacy_projects

散列存储列表项目

To have a simple summary of projects usingHashedstorage:

Omnibus Installation

gitlab-rake gitlab:storage:hashed_projects

Source Installation

rake gitlab: storage:hashed_projects

To list projects usingHashedstorage:

Omnibus Installation

gitlab-rake gitlab:storage:list_hashed_projects

Source Installation

rake gitlab: storage:list_hashed_projects

List attachments on Legacy storage

To have a simple summary of project attachments usingLegacystorage:

Omnibus Installation

gitlab-rake gitlab:storage:legacy_attachments

Source Installation

rake gitlab: storage:legacy_attachments

To list project attachments usingLegacystorage:

Omnibus Installation

gitlab-rake gitlab:storage:list_legacy_attachments

Source Installation

rake gitlab: storage:list_legacy_attachments

List attachments on Hashed storage

To have a simple summary of project attachments usingHashedstorage:

Omnibus Installation

gitlab-rake gitlab:storage:hashed_attachments

Source Installation

rake gitlab: storage:hashed_attachments

To list project attachments usingHashedstorage:

Omnibus Installation

gitlab-rake gitlab:storage:list_hashed_attachments

Source Installation

rake gitlab: storage:list_hashed_attachments
Baidu
map