Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Documentation
Manage
Activity
Members
Labels
Plan
Issues
10
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
TransFem.org
Documentation
Commits
d82822ef
Commit
d82822ef
authored
1 year ago
by
dakkar
Browse files
Options
Downloads
Patches
Plain Diff
Revert "replace fenced code blocks with indented ones"
This reverts commit
816e3697
.
parent
816e3697
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
content/en/docs/install/migrate.md
+105
-95
105 additions, 95 deletions
content/en/docs/install/migrate.md
with
105 additions
and
95 deletions
content/en/docs/install/migrate.md
+
105
−
95
View file @
d82822ef
...
...
@@ -68,34 +68,38 @@ If you use Sonic or ElasticSearch replace that section of the Docker
Compose with the following, as Sharkey currently only supports
meilisearch:
meilisearch:
restart: always
image: getmeili/meilisearch:v1.3.4
environment:
- MEILI_NO_ANALYTICS=true
- MEILI_ENV=production
env_file:
- .config/meilisearch.env
networks:
- calcnet # <-- Use whatever network name is used in the docker compose here
volumes:
- ./meili_data:/meili_data # <--- make sure to replace the volume with one that fits your existing docker compose
```
yml
meilisearch
:
restart
:
always
image
:
getmeili/meilisearch:v1.3.4
environment
:
-
MEILI_NO_ANALYTICS=true
-
MEILI_ENV=production
env_file
:
-
.config/meilisearch.env
networks
:
-
calcnet
# <-- Use whatever network name is used in the docker compose here
volumes
:
-
./meili_data:/meili_data
# <--- make sure to replace the volume with one that fits your existing docker compose
```
If you use DragonflyDB replace it with Redis or KeyDB, as Sharkey
currently does not support DragonflyDB. To do this replace the section
in the docker compose with the following:
redis:
restart: always
image: redis:7-alpine
networks:
- calcnet # <-- Use whatever network name is used in the docker compose here
volumes:
- ./redis:/data # <-- Make sure to replace the volume with the one used in your firefish docker compose
healthcheck:
test: "redis-cli ping"
interval: 5s
retries: 20
```
yml
redis
:
restart
:
always
image
:
redis:7-alpine
networks
:
-
calcnet
# <-- Use whatever network name is used in the docker compose here
volumes
:
-
./redis:/data
# <-- Make sure to replace the volume with the one used in your firefish docker compose
healthcheck
:
test
:
"
redis-cli
ping"
interval
:
5s
retries
:
20
```
Backup your your firefish config and replace it with the
[
default
sharkey
...
...
@@ -112,6 +116,7 @@ volume, starting the newer PostgreSQL on it, and importing the data
from the backup you just made. Refer to
[
the PostgreSQL
documentation
](
https://www.postgresql.org/docs/current/backup-dump.html
)
.
Make sure to update the
*mount paths*
for volumes of the Sharkey
container from
`/firefish/`
to
`/sharkey/`
(so your existing volumes
will show up at the new path, inside the container).
...
...
@@ -129,58 +134,60 @@ work. The following series of SQL queries / commands should do it, but
please read the comments and pay attention to the results after each
query!
-- start a transaction, so we won't leave the db in a halfway state if
-- things go wrong
BEGIN;
-- we need to add back some columns that Firefish removed, but that
-- Sharkey migrations expect
ALTER TABLE "user_profile" ADD "integrations" JSONB NOT NULL DEFAULT '{}';
ALTER TABLE "meta" ADD "twitterConsumerSecret" VARCHAR(128);
ALTER TABLE "meta" ADD "twitterConsumerKey" VARCHAR(128);
ALTER TABLE "meta" ADD "enableTwitterIntegration" BOOLEAN NOT NULL DEFAULT false;
ALTER TABLE "meta" ADD "enableGithubIntegration" BOOLEAN NOT NULL DEFAULT false;
ALTER TABLE "meta" ADD "githubClientId" VARCHAR(128);
ALTER TABLE "meta" ADD "githubClientSecret" VARCHAR(128);
ALTER TABLE "meta" ADD "enableDiscordIntegration" BOOLEAN NOT NULL DEFAULT false;
ALTER TABLE "meta" ADD "discordClientId" VARCHAR(128);
ALTER TABLE "meta" ADD "discordClientSecret" VARCHAR(128);
-- also an extra table, for the same reasons
CREATE TABLE antenna_note();
-- move aside some FireFish columns; Sharkey migrations will
-- re-create them; we don't `DROP` them because we want to keep the data
ALTER TABLE "user" RENAME COLUMN "movedToUri" TO "ff_movedToUri";
ALTER TABLE "user" RENAME COLUMN "alsoKnownAs" TO "ff_alsoKnownAs";
ALTER TABLE "user" RENAME COLUMN "isIndexable" TO "ff_isIndexable";
ALTER TABLE "user" RENAME COLUMN "speakAsCat" TO "ff_speakAsCat";
ALTER TABLE "user_profile" RENAME COLUMN "preventAiLearning" TO "ff_preventAiLearning";
ALTER TABLE "meta" RENAME COLUMN "silencedHosts" TO "ff_silencedHosts";
-- this column was added by both Firefish and Misskey, but with
-- different names, let's fix it
ALTER TABLE "meta" RENAME COLUMN "ToSUrl" TO "termsOfServiceUrl";
-- update antenna types, this is only needed on some instances but
-- recommend to run anyway
--
-- this *removes* any antennas of types not supported by Sharkey!
CREATE TYPE public.new_antenna_src_enum AS ENUM ('home', 'all', 'list');
ALTER TABLE antenna ADD COLUMN new_src public.new_antenna_src_enum;
DELETE FROM antenna WHERE src NOT IN ('home', 'all', 'list');
ALTER TABLE antenna DROP COLUMN src;
ALTER TABLE antenna RENAME COLUMN new_src TO src;
DROP TYPE public.antenna_src_enum;
ALTER TYPE new_antenna_src_enum RENAME TO antenna_src_enum;
-- optional but recommended: delete all empty moderation log entries
DELETE FROM moderation_log WHERE info = '{}';
-- only needed on some instances, run this if
-- `\dT+ user_profile_mutingnotificationtypes_enum`
-- does not show `note` in the "elements" section
ALTER TYPE "public"."user_profile_mutingnotificationtypes_enum" ADD VALUE 'note';
```
sql
-- start a transaction, so we won't leave the db in a halfway state if
-- things go wrong
BEGIN
;
-- we need to add back some columns that Firefish removed, but that
-- Sharkey migrations expect
ALTER
TABLE
"user_profile"
ADD
"integrations"
JSONB
NOT
NULL
DEFAULT
'{}'
;
ALTER
TABLE
"meta"
ADD
"twitterConsumerSecret"
VARCHAR
(
128
);
ALTER
TABLE
"meta"
ADD
"twitterConsumerKey"
VARCHAR
(
128
);
ALTER
TABLE
"meta"
ADD
"enableTwitterIntegration"
BOOLEAN
NOT
NULL
DEFAULT
false
;
ALTER
TABLE
"meta"
ADD
"enableGithubIntegration"
BOOLEAN
NOT
NULL
DEFAULT
false
;
ALTER
TABLE
"meta"
ADD
"githubClientId"
VARCHAR
(
128
);
ALTER
TABLE
"meta"
ADD
"githubClientSecret"
VARCHAR
(
128
);
ALTER
TABLE
"meta"
ADD
"enableDiscordIntegration"
BOOLEAN
NOT
NULL
DEFAULT
false
;
ALTER
TABLE
"meta"
ADD
"discordClientId"
VARCHAR
(
128
);
ALTER
TABLE
"meta"
ADD
"discordClientSecret"
VARCHAR
(
128
);
-- also an extra table, for the same reasons
CREATE
TABLE
antenna_note
();
-- move aside some FireFish columns; Sharkey migrations will
-- re-create them; we don't `DROP` them because we want to keep the data
ALTER
TABLE
"user"
RENAME
COLUMN
"movedToUri"
TO
"ff_movedToUri"
;
ALTER
TABLE
"user"
RENAME
COLUMN
"alsoKnownAs"
TO
"ff_alsoKnownAs"
;
ALTER
TABLE
"user"
RENAME
COLUMN
"isIndexable"
TO
"ff_isIndexable"
;
ALTER
TABLE
"user"
RENAME
COLUMN
"speakAsCat"
TO
"ff_speakAsCat"
;
ALTER
TABLE
"user_profile"
RENAME
COLUMN
"preventAiLearning"
TO
"ff_preventAiLearning"
;
ALTER
TABLE
"meta"
RENAME
COLUMN
"silencedHosts"
TO
"ff_silencedHosts"
;
-- this column was added by both Firefish and Misskey, but with
-- different names, let's fix it
ALTER
TABLE
"meta"
RENAME
COLUMN
"ToSUrl"
TO
"termsOfServiceUrl"
;
-- update antenna types, this is only needed on some instances but
-- recommend to run anyway
--
-- this *removes* any antennas of types not supported by Sharkey!
CREATE
TYPE
public
.
new_antenna_src_enum
AS
ENUM
(
'home'
,
'all'
,
'list'
);
ALTER
TABLE
antenna
ADD
COLUMN
new_src
public
.
new_antenna_src_enum
;
DELETE
FROM
antenna
WHERE
src
NOT
IN
(
'home'
,
'all'
,
'list'
);
ALTER
TABLE
antenna
DROP
COLUMN
src
;
ALTER
TABLE
antenna
RENAME
COLUMN
new_src
TO
src
;
DROP
TYPE
public
.
antenna_src_enum
;
ALTER
TYPE
new_antenna_src_enum
RENAME
TO
antenna_src_enum
;
-- optional but recommended: delete all empty moderation log entries
DELETE
FROM
moderation_log
WHERE
info
=
'{}'
;
-- only needed on some instances, run this if
-- `\dT+ user_profile_mutingnotificationtypes_enum`
-- does not show `note` in the "elements" section
ALTER
TYPE
"public"
.
"user_profile_mutingnotificationtypes_enum"
ADD
VALUE
'note'
;
```
If everything worked and you saw no errors, you can run
`COMMIT;`
in
that same
`psql`
shell, to commit all the changes, then close that
...
...
@@ -196,26 +203,29 @@ Open another `psql` shell like before (`docker exec -it db psql -U
firefish -d firefish`
, replacing things as before). We need another
small pass of massaging.
BEGIN;
-- all existing users are approved, because Firefish doesn't have a
-- concept of approvals
UPDATE "user" SET approved = true;
-- now we put back the data we moved aside
UPDATE "user" SET "movedToUri" = "ff_movedToUri" WHERE "ff_movedToUri" IS NOT NULL;
UPDATE "user" SET "alsoKnownAs" = "ff_alsoKnownAs" WHERE "ff_alsoKnownAs" IS NOT NULL;
UPDATE "user" SET "noindex" = NOT (COALESCE("ff_isIndexable", true));
UPDATE "user" SET "speakAsCat" = COALESCE("ff_speakAsCat", false);
UPDATE "user_profile" SET "preventAiLearning" = COALESCE("ff_preventAiLearning", true);
UPDATE "meta" SET "silencedHosts" = COALESCE("ff_silencedHosts",'{}');
ALTER TABLE "user" DROP COLUMN "ff_movedToUri";
ALTER TABLE "user" DROP COLUMN "ff_alsoKnownAs";
ALTER TABLE "user" DROP COLUMN "ff_isIndexable";
ALTER TABLE "user" DROP COLUMN "ff_speakAsCat";
ALTER TABLE "user_profile" DROP COLUMN "ff_preventAiLearning";
ALTER TABLE "meta" DROP COLUMN "ff_silencedHosts";
```
sql
BEGIN
;
-- all existing users are approved, because Firefish doesn't have a
-- concept of approvals
UPDATE
"user"
SET
approved
=
true
;
-- now we put back the data we moved aside
UPDATE
"user"
SET
"movedToUri"
=
"ff_movedToUri"
WHERE
"ff_movedToUri"
IS
NOT
NULL
;
UPDATE
"user"
SET
"alsoKnownAs"
=
"ff_alsoKnownAs"
WHERE
"ff_alsoKnownAs"
IS
NOT
NULL
;
UPDATE
"user"
SET
"noindex"
=
NOT
(
COALESCE
(
"ff_isIndexable"
,
true
));
UPDATE
"user"
SET
"speakAsCat"
=
COALESCE
(
"ff_speakAsCat"
,
false
);
UPDATE
"user_profile"
SET
"preventAiLearning"
=
COALESCE
(
"ff_preventAiLearning"
,
true
);
UPDATE
"meta"
SET
"silencedHosts"
=
COALESCE
(
"ff_silencedHosts"
,
'{}'
);
ALTER
TABLE
"user"
DROP
COLUMN
"ff_movedToUri"
;
ALTER
TABLE
"user"
DROP
COLUMN
"ff_alsoKnownAs"
;
ALTER
TABLE
"user"
DROP
COLUMN
"ff_isIndexable"
;
ALTER
TABLE
"user"
DROP
COLUMN
"ff_speakAsCat"
;
ALTER
TABLE
"user_profile"
DROP
COLUMN
"ff_preventAiLearning"
;
ALTER
TABLE
"meta"
DROP
COLUMN
"ff_silencedHosts"
;
```
If everything worked and you saw no errors, you can run
`COMMIT;`
in
that same
`psql`
shell, to commit all the changes, then close that
...
...
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