gitlab-org--gitlab-foss/lib/gitlab/import_export.rb
Yorick Peterse 235b105c91
Finish migration to the new events setup
This finishes the procedure for migrating events from the old format
into the new format. Code no longer uses the old setup and the database
tables used during the migration process are swapped, with the old table
being dropped.

While the database migration can be reversed this will 1) take a lot of
time as data has to be coped around 2) won't restore data in the
"events.data" column as we have no way of restoring this.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37241
2017-09-06 16:40:31 +02:00

51 lines
1 KiB
Ruby

module Gitlab
module ImportExport
extend self
# For every version update, the version history in import_export.md has to be kept up to date.
VERSION = '0.2.0'.freeze
FILENAME_LIMIT = 50
def export_path(relative_path:)
File.join(storage_path, relative_path)
end
def storage_path
File.join(Settings.shared['path'], 'tmp/project_exports')
end
def import_upload_path(filename:)
File.join(storage_path, 'uploads', filename)
end
def project_filename
"project.json"
end
def project_bundle_filename
"project.bundle"
end
def config_file
Rails.root.join('lib/gitlab/import_export/import_export.yml')
end
def version_filename
'VERSION'
end
def export_filename(project:)
basename = "#{Time.now.strftime('%Y-%m-%d_%H-%M-%3N')}_#{project.full_path.tr('/', '_')}"
"#{basename[0..FILENAME_LIMIT]}_export.tar.gz"
end
def version
VERSION
end
def reset_tokens?
true
end
end
end