How to change email?

Hello,
I install Grist with docker some time ago and make some nice tables for my work. Now I noticed that I have default email you@example.com when I’m logged on my account. When I login with my real email I have nothing. Do I have to import every table or there’s other way to change email?
Regards.

Hi @Przemek_Skw, there are a lot of options, depending on your setup. Do you have an SSO set up on a shared host, or are you setting GRIST_DEFAULT_EMAIL on an installation on your personal computer? One general method that could help with any method is to go back to being you@example.com for a bit, and sharing the site (if you are using GRIST_SINGLE_ORG) or individual document with the new email address.

An alternative, if this is just on your computer, would be to edit the “home database”. With default settings, you can find it as home.sqlite3:

Make sure to shut Grist down and take backups before trying this. You can remap email addresses in the logins table of this file using the sqlite3 tool:

$ sudo sqlite3 home.sqlite3 
SQLite version 3.37.2 2022-01-06 13:25:41
Enter ".help" for usage hints.
sqlite> .mode box
sqlite> select * from logins;
┌────┬─────────┬────────────────────────┬────────────────────────┐
│ id │ user_id │         email          │     display_email      │
├────┼─────────┼────────────────────────┼────────────────────────┤
│ 1  │ 1       │ anon@getgrist.com      │ anon@getgrist.com      │
│ 2  │ 2       │ thumbnail@getgrist.com │ thumbnail@getgrist.com │
│ 3  │ 3       │ everyone@getgrist.com  │ everyone@getgrist.com  │
│ 4  │ 4       │ support@getgrist.com   │ support@getgrist.com   │
│ 5  │ 5       │ you@example.com        │ you@example.com        │
│ 6  │ 6       │ thing@example.com      │ thing@example.com      │
└────┴─────────┴────────────────────────┴────────────────────────┘
sqlite> update logins set email = 'new@email', display_email = 'new@email' where email = 'you@example.com';
sqlite> select * from logins;
┌────┬─────────┬────────────────────────┬────────────────────────┐
│ id │ user_id │         email          │     display_email      │
├────┼─────────┼────────────────────────┼────────────────────────┤
│ 1  │ 1       │ anon@getgrist.com      │ anon@getgrist.com      │
│ 2  │ 2       │ thumbnail@getgrist.com │ thumbnail@getgrist.com │
│ 3  │ 3       │ everyone@getgrist.com  │ everyone@getgrist.com  │
│ 4  │ 4       │ support@getgrist.com   │ support@getgrist.com   │
│ 5  │ 5       │ new@email              │ new@email              │
│ 6  │ 6       │ thing@example.com      │ thing@example.com      │
└────┴─────────┴────────────────────────┴────────────────────────┘

(sudo needed if OS user id within docker is different). One thing: if you’ve already logged in with the new email at some point, then there will already be a new conflicting row in the table for that - in that case, just remap it to another dummy email to get it out of the way first).

Hi, @paul-grist I instll Grist only for testing some time ago on my local miniPC and it works that way all the time.

docker run -p 8484:8484 \
  -v ~/grist:/persist \
  -e GRIST_SESSION_SECRET=invent-a-secret-here \
  -it gristlabs/grist

So I can share my selfhosted documents to my account in real email in Grist cloud?

@Przemek_Skw I think I’m not understanding something.

I’m not sure how you did that login. With the docker command you posted, I’d expect only a “fake” login where you are immediately signed in as you@example.com, with no password or anything like that. You can change the email address to be anything you like (including real or non-existent addresses) by setting GRIST_DEFAULT_EMAIL. When you do that, a new account is made for that user, so you’ll see no documents initially. The option I suggested about sharing before changing the email address would help with that, as would the changes via sqlite3.

There’s no connection between Grist running on your computer and Grist running anywhere else, if that is the question. Documents can be downloaded from one installation and imported into the other.

I login with my gmail wright now in forum. I can also login that way on https://docs.getgrist.com/ and there I can make documents.

Ok. There is no connection between the servers running at docs.getgrist.com and the server running in your docker container, except that they are based on the same software. You could also configure self-hosted Grist to use google accounts for authentication, but that makes more sense on a shared server than on a single computer. Are you looking for synchronization between a local Grist server and a hosted Grist service?

Can I just work on docs.getgrist.com like I work on my selfhosted? I see there’s free subscription.

Yes you can @Przemek_Skw. If you have big documents you might hit row limits; there are also api rate limits (details here).

1 Like

OK, I export and import everything to my getgrist.com account.
Thanks for help.

1 Like