iceshrimp/docs/migrate.md

83 lines
2.7 KiB
Markdown
Raw Normal View History

2023-02-21 05:13:55 +09:00
# 🚚 Migrating from Misskey to Calckey
## Misskey v13 and above
```sh
2023-02-21 05:16:44 +09:00
wget -O mkv13.patch https://codeberg.org/calckey/calckey/raw/branch/develop/docs/mkv13.patch
git apply mkv13.patch
2023-02-21 05:13:55 +09:00
cd packages/backend
LINE_NUM="$(npx typeorm migration:show -d ormconfig.js | grep -n activeEmailValidation1657346559800 | cut -d ':' -f 1)"
NUM_MIGRATIONS="$(npx typeorm migration:show -d ormconfig.js | tail -n+"$LINE_NUM" | grep '\[X\]' | nl)"
for i in $(seq 1 $NUM_MIGRAIONS); do
npx typeorm migration:revert -d ormconfig.js
done
git remote set-url origin https://codeberg.org/calckey/calckey.git
git fetch
git checkout main # or beta or develop
git pull --ff
2023-02-26 03:08:37 +09:00
NODE_ENV=production pnpm run migrate
2023-02-21 05:13:55 +09:00
# build using prefered method
```
2023-03-30 06:10:00 +09:00
Depending on the version you're migrating from, you may have to open Postgres with `psql -d your_database` and run the following commands:
```sql
ALTER TABLE "meta" ADD COLUMN "disableLocalTimeline" boolean DEFAULT false;
ALTER TABLE "meta" ADD COLUMN "disableGlobalTimeline" boolean DEFAULT false;
ALTER TABLE "meta" ADD COLUMN "localDriveCapacityMb" integer DEFAULT 512;
ALTER TABLE "meta" ADD COLUMN "remoteDriveCapacityMb" integer DEFAULT 128;
ALTER TABLE "user" ADD COLUMN "isSilenced" boolean DEFAULT false;
ALTER TABLE "user" ADD COLUMN "isAdmin" boolean DEFAULT false;
ALTER TABLE "user" ADD COLUMN "isModerator" boolean DEFAULT false;
ALTER TABLE "user" ADD COLUMN "remoteDriveCapacityMb" integer DEFAULT 128;
ALTER TABLE "user" ADD COLUMN "driveCapacityOverrideMb" integer DEFAULT 128;
ALTER TABLE "instance" ADD COLUMN "caughtAt" date;
ALTER TABLE "instance" ADD COLUMN "latestRequestSentAt" date;
ALTER TABLE "instance" ADD COLUMN "latestStatus" character varying(512);
ALTER TABLE "instance" ADD COLUMN "lastCommunicatedAt" date;
```
2023-03-30 06:11:01 +09:00
then quit with `\q`, and restart Calckey.
2023-02-21 05:13:55 +09:00
## Misskey v12.119 and before
```sh
git remote set-url origin https://codeberg.org/calckey/calckey.git
git fetch
git checkout main # or beta or develop
git pull --ff
2023-02-26 03:08:37 +09:00
NODE_ENV=production pnpm run migrate
2023-02-21 05:13:55 +09:00
# build using prefered method
```
## Foundkey
```sh
cd packages/backend
LINE_NUM="$(npx typeorm migration:show -d ormconfig.js | grep -n uniformThemecolor1652859567549 | cut -d ':' -f 1)"
NUM_MIGRATIONS="$(npx typeorm migration:show -d ormconfig.js | tail -n+"$LINE_NUM" | grep '\[X\]' | nl)"
for i in $(seq 1 $NUM_MIGRAIONS); do
npx typeorm migration:revert -d ormconfig.js
done
git remote set-url origin https://codeberg.org/calckey/calckey.git
git fetch
git checkout main # or beta or develop
git pull --ff
2023-02-26 03:08:37 +09:00
NODE_ENV=production pnpm run migrate
2023-02-21 05:13:55 +09:00
# build using prefered method
```
2023-03-31 11:34:42 +09:00
## Reverse
2023-04-26 03:34:19 +09:00
You ***cannot*** migrate back to Misskey from Calckey due to re-hashing passwords on signin with argon2. You can migrate from Calckey to Foundkey, though.