Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
73f8e146
Commit
73f8e146
authored
Mar 18, 2021
by
Rehab Hassanein
Committed by
Marcia Ramos
Mar 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add manual TF states migration snippet
parent
ef47b51c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
doc/administration/terraform_state.md
doc/administration/terraform_state.md
+33
-0
No files found.
doc/administration/terraform_state.md
View file @
73f8e146
...
...
@@ -97,6 +97,39 @@ The following settings are:
|
`remote_directory`
| The bucket name where Terraform state files are stored | |
|
`connection`
| Various connection options described below | |
### Migrate to object storage
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/247042) in GitLab 13.9.
To migrate Terraform state files to object storage, follow the instructions below.
-
For Omnibus package installations:
```
shell
gitlab-rake gitlab:terraform_states:migrate
```
-
For source installations:
```
shell
sudo
-u
git
-H
bundle
exec
rake gitlab:terraform_states:migrate
RAILS_ENV
=
production
```
For GitLab 13.8 and earlier versions, you can use a workaround for the Rake task:
1.
Open the GitLab
[
Rails console
](
operations/rails_console.md
)
.
1.
Run the following commands:
```
ruby
Terraform
::
StateUploader
.
alias_method
(
:upload
,
:model
)
Terraform
::
StateVersion
.
where
(
file_store:
::
ObjectStorage
::
Store
::
LOCAL
).
find_each
(
batch_size:
10
)
do
|
terraform_state_version
|
puts
"Migrating:
#{
terraform_state_version
.
inspect
}
"
terraform_state_version
.
file
.
migrate!
(
::
ObjectStorage
::
Store
::
REMOTE
)
end
```
### S3-compatible connection settings
See
[
the available connection settings for different providers
](
object_storage.md#connection-settings
)
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment