Is it possible to migrate from Misskey Docker v13.13.1 to FoundKey? #396

Closed
opened 2023-06-14 08:34:33 +00:00 by lauralani · 4 comments

Hi, I'd like to migrate from Misskey to FoundKey.

However, the migration guide assumes a "bare metal" installation.

Does anyone know if the migration guide can be adapted with the docker installation?

My idea would be to backup the whole misskey folder, copy the redis and pgsql folders as-is to the new foundkey docker folder and use the FoundKey docker-compose.yml

I'd then start the docker stack and try to run the migration within the foundkey-container.

Do you think that could work? Is there maybe already someone who did it successfully?

Best regards
Laura

Hi, I'd like to migrate from Misskey to FoundKey. However, the [migration guide](https://akkoma.dev/FoundKeyGang/FoundKey/src/branch/main/docs/migrating.md) assumes a "bare metal" installation. Does anyone know if the migration guide can be adapted with the docker installation? My idea would be to backup the whole misskey folder, copy the redis and pgsql folders as-is to the new foundkey docker folder and use the FoundKey docker-compose.yml I'd then start the docker stack and try to run the migration within the foundkey-container. Do you think that could work? Is there maybe already someone who did it successfully? Best regards Laura
Owner

Disclaimer: I've not tried to do a Misskey v13 to Foundkey migration so take this advice with a grain of salt.

You'll need to first revert any migrations from after Misskey v12.111.1 as well before migrating to FoundKey.

I would advise doing a full backup first though since I'm not sure if there'll be any data loss (and how much) from undoing a lot of migrations. We've diverged a lot from Misskey.

You'll probably want to open a shell in the container with docker compose exec web sh first so that it's easier to run those commands. Once inside, the revert stuff should be the same as in the migration guide.

Then you can copy the redis/pgsql folders over as well as the files directory which contains any uploaded media. Then follow the update instructions from the docker install guide.

_Disclaimer: I've not tried to do a Misskey v13 to Foundkey migration so take this advice with a grain of salt._ You'll need to first revert any migrations from after Misskey v12.111.1 as well before migrating to FoundKey. I would advise doing a full backup first though since I'm not sure if there'll be any data loss (and how much) from undoing a lot of migrations. We've diverged a lot from Misskey. You'll probably want to open a shell in the container with `docker compose exec web sh` first so that it's easier to run those commands. Once inside, the revert stuff should be the same as in the migration guide. Then you can copy the redis/pgsql folders over as well as the `files` directory which contains any uploaded media. Then follow the update instructions from the docker install guide.
Owner

Technically it is probably possible, but I am neither knowledgeable about Docker, nor have I kept up much with what Misskey has been doing.

As norm already noted there may be some data lost if you migrate. Since as I said I do not know what Misskey has been doing (and doing so would be quite a lot of work) I cannot really advise you on which if any data could be lost in the process.

Technically it is probably possible, but I am neither knowledgeable about Docker, nor have I kept up much with what Misskey has been doing. As norm already noted there may be some data lost if you migrate. Since as I said I do not know what Misskey has been doing (and doing so would be quite a lot of work) I cannot really advise you on *which if any* data could be lost in the process.
Author

Hm somewhere along the migration reverts something doesnt work as expected:

...
dropGroup1676434944993 is the last executed migration. It was executed on Wed Feb 15 2023 04:22:24 GMT+0000 (Coordinated Universal Time).
Now reverting it...
query: START TRANSACTION
query: ALTER TABLE "user_profile" ALTER COLUMN "emailNotificationTypes" SET DEFAULT '["follow", "receiveFollowRequest", "groupInvited"]'
query: CREATE TYPE "public"."antenna_src_enum_old" AS ENUM('home', 'all', 'users', 'list', 'group')
query: ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "public"."antenna_src_enum_old" USING "src"::"text"::"public"."antenna_src_enum_old"
query: DROP TYPE "public"."antenna_src_enum"
query: ALTER TYPE "public"."antenna_src_enum_old" RENAME TO "antenna_src_enum"
query: ALTER TABLE "notification" ADD "userGroupInvitationId" character varying(32)
query failed: ALTER TABLE "notification" ADD "userGroupInvitationId" character varying(32)
error: error: relation "notification" does not exist
query: ROLLBACK
Error during migration revert:
QueryFailedError: relation "notification" does not exist
    at PostgresQueryRunner.query (/misskey/node_modules/.pnpm/typeorm@0.3.16_ioredis@5.3.2_pg@8.11.0/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async dropGroup1676434944993.down (file:///misskey/packages/backend/migration/1676434944993-drop-group.js:22:9)
    at async MigrationExecutor.undoLastMigration (/misskey/node_modules/.pnpm/typeorm@0.3.16_ioredis@5.3.2_pg@8.11.0/node_modules/typeorm/migration/MigrationExecutor.js:312:17)
    at async DataSource.undoLastMigration (/misskey/node_modules/.pnpm/typeorm@0.3.16_ioredis@5.3.2_pg@8.11.0/node_modules/typeorm/data-source/DataSource.js:274:9)
    at async Object.handler (/misskey/node_modules/.pnpm/typeorm@0.3.16_ioredis@5.3.2_pg@8.11.0/node_modules/typeorm/commands/MigrationRevertCommand.js:67:13) {
  query: 'ALTER TABLE "notification" ADD "userGroupInvitationId" character varying(32)',
  parameters: undefined,
  driverError: error: relation "notification" does not exist
      at Parser.parseErrorMessage (/misskey/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/dist/parser.js:287:98)
      at Parser.handlePacket (/misskey/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/dist/parser.js:126:29)
      at Parser.parse (/misskey/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/dist/parser.js:39:38)
      at Socket.<anonymous> (/misskey/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/dist/index.js:11:42)
      at Socket.emit (node:events:513:28)
      at addChunk (node:internal/streams/readable:324:12)
      at readableAddChunk (node:internal/streams/readable:297:9)
      at Readable.push (node:internal/streams/readable:234:10)
      at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
    length: 110,
    severity: 'ERROR',
    code: '42P01',
    detail: undefined,
    hint: undefined,
    position: undefined,
    internalPosition: undefined,
    internalQuery: undefined,
    where: undefined,
    schema: undefined,
    table: undefined,
    column: undefined,
    dataType: undefined,
    constraint: undefined,
    file: 'namespace.c',
    line: '433',
    routine: 'RangeVarGetRelidExtended'
  },
  length: 110,
  severity: 'ERROR',
  code: '42P01',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'namespace.c',
  line: '433',
  routine: 'RangeVarGetRelidExtended'
}
query: SELECT * FROM current_schema()
query: SELECT version();
query: SELECT * FROM "information_schema"."tables" WHERE "table_schema" = 'public' AND "table_name" = 'migrations'
query: SELECT * FROM "migrations" "migrations" ORDER BY "id" DESC

Guess ima roll back and try again sometimes later

Hm somewhere along the migration reverts something doesnt work as expected: ``` ... dropGroup1676434944993 is the last executed migration. It was executed on Wed Feb 15 2023 04:22:24 GMT+0000 (Coordinated Universal Time). Now reverting it... query: START TRANSACTION query: ALTER TABLE "user_profile" ALTER COLUMN "emailNotificationTypes" SET DEFAULT '["follow", "receiveFollowRequest", "groupInvited"]' query: CREATE TYPE "public"."antenna_src_enum_old" AS ENUM('home', 'all', 'users', 'list', 'group') query: ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "public"."antenna_src_enum_old" USING "src"::"text"::"public"."antenna_src_enum_old" query: DROP TYPE "public"."antenna_src_enum" query: ALTER TYPE "public"."antenna_src_enum_old" RENAME TO "antenna_src_enum" query: ALTER TABLE "notification" ADD "userGroupInvitationId" character varying(32) query failed: ALTER TABLE "notification" ADD "userGroupInvitationId" character varying(32) error: error: relation "notification" does not exist query: ROLLBACK Error during migration revert: QueryFailedError: relation "notification" does not exist at PostgresQueryRunner.query (/misskey/node_modules/.pnpm/typeorm@0.3.16_ioredis@5.3.2_pg@8.11.0/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async dropGroup1676434944993.down (file:///misskey/packages/backend/migration/1676434944993-drop-group.js:22:9) at async MigrationExecutor.undoLastMigration (/misskey/node_modules/.pnpm/typeorm@0.3.16_ioredis@5.3.2_pg@8.11.0/node_modules/typeorm/migration/MigrationExecutor.js:312:17) at async DataSource.undoLastMigration (/misskey/node_modules/.pnpm/typeorm@0.3.16_ioredis@5.3.2_pg@8.11.0/node_modules/typeorm/data-source/DataSource.js:274:9) at async Object.handler (/misskey/node_modules/.pnpm/typeorm@0.3.16_ioredis@5.3.2_pg@8.11.0/node_modules/typeorm/commands/MigrationRevertCommand.js:67:13) { query: 'ALTER TABLE "notification" ADD "userGroupInvitationId" character varying(32)', parameters: undefined, driverError: error: relation "notification" does not exist at Parser.parseErrorMessage (/misskey/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/dist/parser.js:287:98) at Parser.handlePacket (/misskey/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/dist/parser.js:126:29) at Parser.parse (/misskey/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/dist/parser.js:39:38) at Socket.<anonymous> (/misskey/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/dist/index.js:11:42) at Socket.emit (node:events:513:28) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) at Readable.push (node:internal/streams/readable:234:10) at TCP.onStreamRead (node:internal/stream_base_commons:190:23) { length: 110, severity: 'ERROR', code: '42P01', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'namespace.c', line: '433', routine: 'RangeVarGetRelidExtended' }, length: 110, severity: 'ERROR', code: '42P01', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'namespace.c', line: '433', routine: 'RangeVarGetRelidExtended' } query: SELECT * FROM current_schema() query: SELECT version(); query: SELECT * FROM "information_schema"."tables" WHERE "table_schema" = 'public' AND "table_name" = 'migrations' query: SELECT * FROM "migrations" "migrations" ORDER BY "id" DESC ``` Guess ima roll back and try again sometimes later

We documented the process of migrating from Mk v13 to Calckey -- this may also help with Foundkey. https://calckey.org/docs/en/migrating/

We documented the process of migrating from Mk v13 to Calckey -- this may also help with Foundkey. https://calckey.org/docs/en/migrating/
Sign in to join this conversation.
No Label
feature
fix
upkeep
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: FoundKeyGang/FoundKey#396
No description provided.