I started by trying to find if I could temporarily turn off autoincrement but came across something that said I didn't have to as long as it doesn't violate uniqueness. I went through a lot of links before I found that and I can't find it now but I found this:
https://dev.mysql.com/doc/refman/8.0/en ... ement.html which contains:
========================
When you insert any other value into an AUTO_INCREMENT column, the column is set to that value and the sequence is reset so that the next automatically generated value follows sequentially from the largest column value. For example:
INSERT INTO animals (id,name) VALUES(100,'rabbit');
INSERT INTO animals (id,name) VALUES(NULL,'mouse');
SELECT * FROM animals;
+-----+-----------+
| id | name |
+-----+-----------+
| 1 | dog |
| 2 | cat |
| 3 | penguin |
| 4 | lax |
| 5 | whale |
| 6 | ostrich |
| 7 | groundhog |
| 8 | squirrel |
| 100 | rabbit |
| 101 | mouse |
+-----+-----------+
================================
That's an older version I think, my @@version returns 10.4.32 Maria but maybe it will work.
On the happy front, I exported the user, usergroup, and profile_data tables and the generated insert sql statements will be easy for me to modify to add users directly. I''ll take the insert SQL from each table for a typical user, modify the sql to insert one user, and if that works, I'll write a program in vb or C# to run through the resident dump from our management office and generate the appropriate SQL inserts. It should work.
There are a few fields that I'm not sure how to handle, password being one of them. I won't have access to whatever MD5 hash phpBB uses so I'll just duplicate whatever password one of my test users has (not a simple abc) and use that for all the generated users. They'll just have to use the "lost password" function when they first logon. IP address looks pointless to me, people can have VPNs or dynamic addresses. I'll leave them as whatever my test user is (my ip address). Username comes from the office dump and username_clean usually is just lowercase. I'll manually eyeball the management dump just to see what might complicate it. Some users have TTEE in the name, which is some kind of trust and needs to be filtered out of the username and _clean.
Ah well, I'll try to insert a user today and see if the autoincrement stays happy, then I'll get to the other issues.
https://dev.mysql.com/doc/refman/8.0/en ... ement.html which contains:
========================
When you insert any other value into an AUTO_INCREMENT column, the column is set to that value and the sequence is reset so that the next automatically generated value follows sequentially from the largest column value. For example:
INSERT INTO animals (id,name) VALUES(100,'rabbit');
INSERT INTO animals (id,name) VALUES(NULL,'mouse');
SELECT * FROM animals;
+-----+-----------+
| id | name |
+-----+-----------+
| 1 | dog |
| 2 | cat |
| 3 | penguin |
| 4 | lax |
| 5 | whale |
| 6 | ostrich |
| 7 | groundhog |
| 8 | squirrel |
| 100 | rabbit |
| 101 | mouse |
+-----+-----------+
================================
That's an older version I think, my @@version returns 10.4.32 Maria but maybe it will work.
On the happy front, I exported the user, usergroup, and profile_data tables and the generated insert sql statements will be easy for me to modify to add users directly. I''ll take the insert SQL from each table for a typical user, modify the sql to insert one user, and if that works, I'll write a program in vb or C# to run through the resident dump from our management office and generate the appropriate SQL inserts. It should work.
There are a few fields that I'm not sure how to handle, password being one of them. I won't have access to whatever MD5 hash phpBB uses so I'll just duplicate whatever password one of my test users has (not a simple abc) and use that for all the generated users. They'll just have to use the "lost password" function when they first logon. IP address looks pointless to me, people can have VPNs or dynamic addresses. I'll leave them as whatever my test user is (my ip address). Username comes from the office dump and username_clean usually is just lowercase. I'll manually eyeball the management dump just to see what might complicate it. Some users have TTEE in the name, which is some kind of trust and needs to be filtered out of the username and _clean.
Ah well, I'll try to insert a user today and see if the autoincrement stays happy, then I'll get to the other issues.
Statistics: Posted by dgkulick — Wed Feb 07, 2024 4:46 pm