Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alex Gleason
pleroma
Commits
16a5d7e2
Verified
Commit
16a5d7e2
authored
4 years ago
by
Alex Gleason
Browse files
Options
Downloads
Patches
Plain Diff
migrate_to_db --force
parent
3a2b2cb6
Branches
pleroma-mrf-silence
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#28732
failed
4 years ago
Stage: build
Stage: test
Stage: benchmark
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/administration/CLI_tasks/config.md
+3
-3
3 additions, 3 deletions
docs/administration/CLI_tasks/config.md
lib/mix/tasks/pleroma/config.ex
+15
-12
15 additions, 12 deletions
lib/mix/tasks/pleroma/config.ex
with
18 additions
and
15 deletions
docs/administration/CLI_tasks/config.md
+
3
−
3
View file @
16a5d7e2
...
...
@@ -5,18 +5,18 @@
## Transfer config from file to DB.
!!! note
You
need to
add the following to your config before executing this command:
You
should
add the following to your config before executing this command:
```elixir
config :pleroma, configurable_from_database: true
```
```
sh tab="OTP"
./bin/pleroma_ctl config migrate_to_db
./bin/pleroma_ctl config migrate_to_db
[-f | --force]
```
```
sh tab="From Source"
mix pleroma.config migrate_to_db
mix pleroma.config migrate_to_db
[-f | --force]
```
...
...
This diff is collapsed.
Click to expand it.
lib/mix/tasks/pleroma/config.ex
+
15
−
12
View file @
16a5d7e2
...
...
@@ -13,9 +13,16 @@ defmodule Mix.Tasks.Pleroma.Config do
@shortdoc
"Manages the location of the config"
@moduledoc
File
.
read!
(
"docs/administration/CLI_tasks/config.md"
)
def
run
([
"migrate_to_db"
])
do
def
run
([
"migrate_to_db"
|
options
])
do
start_pleroma
()
migrate_to_db
()
{
opts
,
_
}
=
OptionParser
.
parse!
(
options
,
strict:
[
force:
:boolean
],
aliases:
[
f:
:force
]
)
migrate_to_db
(
opts
)
end
def
run
([
"migrate_from_db"
|
options
])
do
...
...
@@ -30,18 +37,14 @@ def run(["migrate_from_db" | options]) do
migrate_from_db
(
opts
)
end
@spec
migrate_to_db
(
Path
.
t
()
|
nil
)
::
any
()
def
migrate_to_db
(
file_path
\\
nil
)
do
if
Pleroma
.
Config
.
get
([
:configurable_from_database
])
do
@spec
migrate_to_db
(
map
()
)
::
any
()
def
migrate_to_db
(
opts
)
do
if
Pleroma
.
Config
.
get
([
:configurable_from_database
])
||
opts
[
:force
]
do
config_file
=
if
file_path
do
file
_path
if
Pleroma
.
Config
.
get
(
:release
)
do
Pleroma
.
Config
.
get
(
:config
_path
)
else
if
Pleroma
.
Config
.
get
(
:release
)
do
Pleroma
.
Config
.
get
(
:config_path
)
else
"config/
#{
Pleroma
.
Config
.
get
(
:env
)
}
.secret.exs"
end
"config/
#{
Pleroma
.
Config
.
get
(
:env
)
}
.secret.exs"
end
do_migrate_to_db
(
config_file
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment