Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-06-09 15:56:11 +0300
committerStan Hu <stanhu@gmail.com>2019-06-09 15:56:11 +0300
commitb7e3a1e0409d88c86bf67797749b507a3d480c59 (patch)
tree3b8774ba169415b9fe58449635697dbddb165051 /doc
parent2a01cb79560a861a7e32e9ee11e823f22e181aa1 (diff)
Revert "Merge branch '50070-legacy-attachments' into 'master'"
This reverts commit fd19f887dfeeeedb483c4a4fb32f9f768e89389c, reversing changes made to abb2d4c601d796339c8d7cb0c00946696730f198.
Diffstat (limited to 'doc')
-rw-r--r--doc/administration/troubleshooting/migration.md82
1 files changed, 0 insertions, 82 deletions
diff --git a/doc/administration/troubleshooting/migration.md b/doc/administration/troubleshooting/migration.md
deleted file mode 100644
index 4d2d268b9df..00000000000
--- a/doc/administration/troubleshooting/migration.md
+++ /dev/null
@@ -1,82 +0,0 @@
-# Migrations problems
-
-## Legacy upload migration
-
-> Introduced in GitLab 12.0.
-
- The migration takes all attachments uploaded by legacy `AttachmentUploader` and
- migrate them to the path that current uploaders expect.
-
-Although it should not usually happen there could possibly be some attachments belonging to
-LegacyDiffNotes. These attachments can't be seen before running the migration by users and
-they should not be present in your instance.
-
-However, if you have some of them, you will need to handle them manually.
-You can find the ids of failed notes in logs as "MigrateLegacyUploads: LegacyDiffNote"
-
-1. Run a Rails console:
-
- ```sh
- sudo gitlab-rails console production
- ```
-
- or for source installs:
-
- ```sh
- bundle exec rails console production
- ```
-
- 1. Check the failed upload and find the note (you can see their ids in the logs)
-
- ```ruby
- upload = Upload.find(upload_id)
- note = Note.find(note_id)
- ```
-
-
- 1. Check the path - it should contain `system/note/attachment`
-
- ```ruby
- upload.absolut_path
- ```
-
- 1. Check the path in the uploader - it should differ from the upload path and should contain `system/legacy_diff_note`
-
- ```ruby
- uploader = upload.build_uploader
- uploader.file
- ```
-
- 1. First, you need to move the file to the path that is expected from the uploader
-
- ```ruby
- old_path = upload.absolute_path
- new_path = upload.absolute_path.sub('-/system/note/attachment', '-/system/legacy_diff_note')
- new_dir = File.dirname(new_path)
- FileUtils.mkdir_p(new_dir)
-
- FileUtils.mv(old_path, new_path)
- ```
-
- 1. You then need to move the file to the `FileUploader` and create a new `Upload` object
-
- ```ruby
- file_uploader = UploadService.new(note.project, File.read(new_path)).execute
- ```
-
- 1. And update the legacy note to contain the file.
-
- ```ruby
- new_text = "#{note.note} \n #{file_uploader.markdown_link}"
- note.update!(
- note: new_text
- )
- ```
-
- 1. And finally, you can remove the old upload
-
- ```ruby
- upload.destroy
- ```
-
-If you have any problems feel free to contact [GitLab Support](https://about.gitlab.com/support/).