feed-me
feed-me copied to clipboard
Error importing users into fresh database: 1048 Column 'uid' cannot be null
Description
When importing users, all users with the admin role all return with an error and are not included in the import. The error looks like:

| info | ↳ Users: Match existing element with data {"username":"applausewebmaster"}. | 5/22/2021 11:30 AM |
|---|---|---|
| info | ↳ Users: Data ready to import {"username":"applausewebmaster","firstName":"applause","lastName":"webmaster","email":"[email protected]","preferredLocale":"","id":"1"}. | 5/22/2021 11:30 AM |
| error | ↳ Users: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'uid' cannot be null The SQL being executed was: UPDATE elements SET dateUpdated='2021-05-22 15:31:00', uid=NULL WHERE id=1 - Schema.php: 678. | 5/22/2021 11:31 AM |
Other users who were not admins import successfully.
Steps to reproduce
- Have a Craft site with several users, some with the Admin role and some without.
- Export all of the user data via Craft CMS gui (I chose extended JSON)
- Create a new database, run Craft installation, and then sync your project-config - this creates the schema.
- Use Feed-Me to set up a feed for the new database - the fields are 1 to 1 as it's the same site schema.
- Run the import feed.
- Get error.
Additional info
Craft edition & version | Craft Pro 3.6.15 Database driver & version | MySQL 5.7.32 PHP version | 7.4.12

(I hate that I can't easily copy/paste the details from the system report here...it breaks the markup super badly.)