Skip to content
Snippets Groups Projects
Commit 7dc76094 authored by kaiyou's avatar kaiyou
Browse files

Add migration instructions for Seafile

parent 942c02cd
No related branches found
No related tags found
No related merge requests found
......@@ -20,4 +20,33 @@ OAUTH_ATTRIBUTE_MAP = {
}
</pre>
<h3>Migrating accounts</h3>
<p>If you are running an existing Seafile server, you may import your existing accounts as claimable
profiles under Hiboo.
</p>
<p>Accounts are stored in the <i>EmailUser</i> table of the <i>ccnet_db</i> database. However, we recommend
that profiles be named after the username instead of the email address. The following SQL query exports
username, password hash, and user email as alternate claim to a CSV file. It dynamically converts the password
to use a proper crypt context hash identifier, so that Hiboo will recognize the hash.
</p>
<pre>
select
profile.nickname,
user.email,
CONCAT('$pbkdf2-sha256$10000$', SUBSTRING(TO_BASE64(UNHEX(SUBSTRING(user.passwd,20,64))),1,43), '$', SUBSTRING(TO_BASE64(UNHEX(SUBSTRING(user.passwd,85,64))),1,43)) as password
from
ccnet_db.EmailUser as user
left join
seahub_db.profile_profile as profile
on
profile.user=user.email
into
outfile '/tmp/users.csv'
fields terminated by ',';
</pre>
<p>Please grab the exported CSV file, copy it next to Hiboo, and run the following command to import these profiles as unclaimed.</p>
<pre>
flask profile csv-unclaimed {{ service.uuid }} /tmp/users.csv
</pre>
{% include "application_oidc.html" %}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment