User Data import from Spanner to Auth0

Hello Team,
Can we directly import/full load user data into Auth0 DB, from GCP Spanner database. As of now we can see only 512KB file we can import via import job API.

Can you please help if we can import bulk dataaround 12 lacs profile in Auth0

Hi @dipesh.agrawal,

Welcome to the Auth0 Community!

You will need to split the import into batches if it exceeds the stated limit (currently 500kb).

What is “12 lacs profile”? Could you please provide an example?

1 Like

Thanks Dan for the reply but we have 12 lacs users profile data which is exists in cloud spanner database and now we need to migrate this data to Auth0. We have tried creating JSON and 1000 profile json size is around 500 KB file size. so its very difficult to create that much json file to import the data in AUth0

One more thing when we are trying to import the data in Auth0 using import APi we are getting below error.

{“statusCode”:400,“error”:“Bad Request”,“message”:“Users file must not be empty.”,“errorCode”:“operation_not_supported”}

Below is the code which we are using.

String fileName = "C:\\file\\profiledi.json";
		HttpResponse<String> response = Unirest.post(auth0_userImportapi).header("authorization", token)
				.header("content-type", "multipart/form-data; boundary=---011000010111000001101001")
				.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"users\"; filename=\""
						+ fileName
						+ "\"\r\nContent-Type: text/json\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"connection_id\"\r\n\r\nCONNECTION_ID\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_id\"\r\n\r\nEXTERNAL_ID\r\n-----011000010111000001101001--\r\n")
				.asString();

Kindly suggest what wrong we are doing here.

@dipesh.agrawal,

That request looks a bit odd. How did you find that code snippet?

Take a look at our code examples here: Auth0 Management API v2

Also, can you please give an example of the user profile you are trying to import?

Hello Dan,

I was following the below api from document for import data in auth0.

HttpResponse<String> response = Unirest.post("https://dev-iam-kw.eu.auth0.com/api/v2/jobs/users-imports")
  .header("authorization", "Bearer MGMT_API_ACCESS_TOKEN")
  .header("content-type", "multipart/form-data; boundary=---011000010111000001101001")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"users\"; filename=\"USERS_IMPORT_FILE.json\"\r\nContent-Type: text/json\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"connection_id\"\r\n\r\nCONNECTION_ID\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_id\"\r\n\r\nEXTERNAL_ID\r\n-----011000010111000001101001--\r\n")
  .asString();

https://auth0.com/docs/manage-users/user-migration/bulk-user-imports

PFB the user profile json which i am trying to import.

[
{
		"user_id":"43a73ee3-8883-480d-8eba-7616a3b15f00",
		"family_name": "Dipesh",
        "given_name": "Agrawal",
        "email": "icapsmx866@mailinator.com",
        "email_verified": false,
		"created_at": "2016-12-05T11:16:59.640Z",
		"user_metadata": {
        "mobile": "1234567"
    },
        "custom_password_hash": {
            "algorithm": "sha512",
            "hash": {
                "value": "1a108e87ffea9a30c2ecf86fb26b8d95e62847da5d1dda6a4b97d11967cadd5d7c32ae8bde761a56854a55c7a601f172200d2d23be0310661d053aef6e158a0f",
                "encoding": "hex"
            },
            "salt": {
                "value": "2f0892fc14151ad92fc7f174bf0f48a7",
				"encoding": "hex",
                "position": "prefix"
            }
        }
    }
	]

You could try the explorer and see if it’s the file that is causing the error or the code snippet.

That code snippet looks a bit odd to me, I would use the one on the management API doc, or just build your own request.

ok Thanks Dan, I will try and let you know

Hi Dan,

Thanks for the reply, I have tried and i am able to import the user in AUth0 . Thank you so much.

Regarding the bulk import as you told we can upload only 512 KB size file while doing import but as i told earlier we have around 12 lacs profile which we need to migrate to Auth0 and in 512 KB file we can add max 1000 users data so how we can achieve this. Kindly let us know.

Apologies, what does “12 lacs” mean?

We are currently Live in KW market where already 12 lacs customer profile present in Cloud spanner database and now we need to migrate those customer in Auth0

What is the meaning of the word “12 lacs”?

12 lacs means 12 lacs customers profile

@dipesh.agrawal,

I’m not sure what “lacs” are, is it an acronym for something?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.