Bulk import of users / projects?


#1

How can I import a [csv | calc | json | text] file with usernames, email, password, project assignements without further manual ui interaction of an administrator?

Imported users should be immediately approved, email should be validated and I would like to have projects assigned to them.

I would like to maintain one libreoffice calc table with this information to be able to quickly setup a new instance of Phabricator when a disaster happens. I am flexible with the exact format of that file, e.g. also could be separate file for each project with usernames. Just looking for a quick way to setup users / projects.


#2

You can use ./bin/accountadmin to add users one by one, or you can use the “invite users” feature to invite them by email and let them create their own accounts.

For managing projects, you can use the project.edit conduit method with transaction type members.add or members.set.


#3

Thanks for you quick response.

How can I import a csv file with accountadmin ?
Sorry, I am a little bit tired and I do not get it. Are there some options to feed a csv into that command?
Any documenation about that?
bin/accountadmin -help or bin/accountadmin --help
does not output any useful information but takes me into the interactive mode.
I mean, I am not the first one who wants to do a bulk user import, am I?
Thanks again for your attention!


#4

There’s no built-in way to bulk import users, as far as I know.

Most installs set up an external login mechanizem to something they already have (LDAP, Google, Github…) and just invite all users to self-sign up.
Others take the accountadmin script and adapt it to run in a loop.

For backup, you would normally backup/restore the entire database, not just usernames - see https://phurl.io/u/backups.