Add finnish version of the first post, refactor AsciiDoc on other pages
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

Now the documents follow the AsciiDoctor best practices https://asciidoctor.org/docs/asciidoc-recommended-practices/
This commit is contained in:
Marko Korhonen 2024-01-28 11:40:09 +02:00
parent 2b3a0bfa34
commit 12b21aec19
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890
8 changed files with 198 additions and 153 deletions

View file

@ -11,50 +11,39 @@ menu:
:toc:
= Migrate Misskey root account
I recently migrated my single user Fediverse server from
https://misskey-hub.net[Misskey] to https://joinfirefish.org[Firefish] and
I encountered an issue that I did not find documented elsewhere, so
I thought I'd write down the solution I found, in case anyone would
benefit from it and save some time in the future.
I recently migrated my single user Fediverse server from https://misskey-hub.net[Misskey] to https://joinfirefish.org[Firefish].
During the migration I encountered an issue that I did not find documented elsewhere.
I thought I'd write down the solution I found, in case anyone would benefit from it and save some time in the future.
I decided to migrate to a new domain at the same time, so the easiest way
was just to create a new server and migrate my account and not fuss about
migrating the Misskey instance itself.
I decided to migrate to a new domain at the same time, so the easiest way was just to create a new server and migrate my account and not fuss about migrating the Misskey instance itself.
Being a single user instance, my account was also the "root" account of
Misskey. Misskey does not allow migrating the root account, if trying to do
so, you will just get an error along the lines of "root cannot migrate".
Being a single user instance, my account was also the "root" account of Misskey.
Misskey does not allow migrating the root account, if trying to do so, you will just get an error along the lines of "root cannot migrate".
== Solution
I took to the database to find out what I can do bypassing the UI, and lo and
behold, I found an `isRoot` column in the `user` table. I didn't want to end up
without a root account on my old instance however, so I went to the Misskey
control panel and created a new account, simply called 'root'.
I took to the database to find out what I can do bypassing the UI, and lo and behold, I found an `isRoot` column in the `user` table.
I didn't want to end up without a root account on my old instance however, so I went to the Misskey control panel and created a new account, simply called "root".
Misskey seems to save all of it's known users to the `user` table, not only
the actual local accounts. To find the local accounts only, you can use
the following query
Misskey seems to save all of it's known users to the `user` table, not only the actual local accounts.
To find the local accounts only, you can use the following query
[source,sql]
----
include::code/query_users[]
include::code/query_users.sql[]
----
Now you can simply make your new root account's `isRoot` column `true` and
your actual user account `false`. After that, the migration will work.
Now you can simply make your new root account's `isRoot` column `true` and your actual user account `false`.
After that, the migration will work.
[source,sql]
----
include::code/update_users[]
include::code/update_users.sql[]
----
You should probably check that you only modified 2 rows before committing the
transaction.
You should probably check that you only modified 2 rows before committing the transaction.
I would imagine that this solution should work for the numerous Misskey forks
around, but I have not tested it so your results may vary.
I would imagine that this solution should work for the numerous Misskey forks around, but I have not tested it so your results may vary.
If you found this post useful, make sure to share, tweet, toot, bleep and bloop
this on your social media service of choice. If you have any issues with this
process, you can leave a comment below and I will try to help you out.
If you found this post useful, make sure to share, tweet, toot, bleep and bloop this on your social media service of choice.
If you have any issues with this process, you can leave a comment below and I will try to help you out.

View file

@ -12,53 +12,39 @@ menu:
:toc:
= Misskeyn root-tilin migraatio
Vaihdoin äskettäin yhden käyttäjän Fediverse-palvelimeni
https://misskey-hub.net[Misskey]stä https://joinfirefish.org[Firefish]iin ja
kohtasin ongelman, jota en löytänyt dokumentoituna muualla. Päätin jakaa
löytämäni ratkaisun, jos joku muu hyötyisi siitä ja säästäisi aikaansa
tulevaisuudessa.
Vaihdoin äskettäin yhden käyttäjän Fediverse-palvelimeni https://misskey-hub.net[Misskey]stä https://joinfirefish.org[Firefish]iin.
Kohtasin ongelman, jota en löytänyt dokumentoituna muualla.
Päätin jakaa löytämäni ratkaisun, jos joku muu hyötyisi siitä ja säästäisi aikaansa tulevaisuudessa.
Päätin samalla siirtyä uuteen verkkotunnukseen, joten helpoin tapa oli luoda
uusi palvelin ja migratoida käyttäjätili sen sijaan, että vaivautuisin
migratoimaan koko Misskey-instanssia.
Päätin samalla siirtyä uuteen verkkotunnukseen, joten helpoin tapa oli luoda uusi palvelin ja migratoida käyttäjätili sen sijaan, että vaivautuisin migratoimaan koko Misskey-instanssia.
Koska kyseessä oli yhden käyttäjän instanssi, tili oli myös Misskeyn "root"
tili. Misskey ei salli root-tilin siirtämistä, ja jos yrität, saat virheen
"root cannot migrate" tai jotain sinne päin.
Koska kyseessä oli yhden käyttäjän instanssi, tili oli myös Misskeyn "root" tili.
Misskey ei salli root-tilin siirtämistä, ja jos yrität, saat virheen "root cannot migrate" tai jotain sinne päin.
== Ratkaisu
Menin tietokantaan selvittääkseni, mitä voisin tehdä ohittamalla
käyttöliittymän, ja kas, löysin `isRoot`-sarakkeen `user`-taulusta. En
kuitenkaan halunnut jäädä ilman root-tiliä vanhassa instanssissani,
joten menin Misskeyn hallintapaneeliin ja loin uuden tilin, yksinkertaisesti
nimeltään 'root'.
Menin tietokantaan selvittääkseni, mitä voisin tehdä ohittamalla käyttöliittymän, ja kas, löysin `isRoot`-sarakkeen `user`-taulusta.
En kuitenkaan halunnut jäädä ilman root-tiliä vanhassa instanssissani, joten menin Misskeyn hallintapaneeliin ja loin uuden tilin, yksinkertaisesti nimeltään "root".
Misskey näyttää tallentavan kaikki tunnetut käyttäjät `user`-tauluun, ei vain
varsinaisia paikallia käyttäjätilejä. Paikallisten tilien löytämiseksi voit
käyttää seuraavaa kyselyä
Misskey näyttää tallentavan kaikki tunnetut käyttäjät `user`-tauluun, ei vain varsinaisia paikallia käyttäjätilejä.
Paikallisten tilien löytämiseksi voit käyttää seuraavaa kyselyä
[source]
[source,sql]
----
include::code/query_users[]
include::code/query_users.sql[]
----
Nyt voit yksinkertaisesti asettaa uuden root-tilin `isRoot`-sarakkeen arvoksi
`true` ja oman käyttäjätilin arvoksi `false`. Sen jälkeen migraation pitäisi
toimia.
Nyt voit yksinkertaisesti asettaa uuden root-tilin `isRoot`-sarakkeen arvoksi `true` ja oman käyttäjätilin arvoksi `false`.
Sen jälkeen migraation pitäisi toimia.
[source]
[source,sql]
----
include::code/update_users[]
include::code/update_users.sql[]
----
Kannattaa varmistaa, että muutit vain 2 riviä ennen kuin kommitoit
transaktion.
Kannattaa varmistaa, että muutit vain 2 riviä ennen kuin kommitoit transaktion.
Olettaisin, että tämä ratkaisu toimii myös Misskey forkeissa, mutta en ole
testannut.
Olettaisin, että tämä ratkaisu toimii myös Misskey forkeissa, mutta en ole testannut.
Jos tästä postauksesta oli sinulle hyötyä, muista jakaa, twiitata, tuutata ja
piippailla se haluamassasi sosiaalisen median palvelussa. Jos sinulla on
ongelmia tässä prosessissa, voit myös jättää kommentin alapuolella
niin voin yrittää auttaa.
Jos tästä postauksesta oli sinulle hyötyä, muista jakaa, twiitata, tuutata ja piippailla se haluamassasi sosiaalisen median palvelussa.
Jos sinulla on ongelmia tässä prosessissa, voit myös jättää kommentin alapuolelle niin voin yrittää auttaa.