Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: 6Dasher on April 23, 2018, 11:33:10 PM

Title: Setting AutoIncrement on tables after importing
Post by: 6Dasher on April 23, 2018, 11:33:10 PM
So I just moved my site to a new host. I did a fresh install of SMF with new versions of all the mods, transfered all files (even Filezilla in binary mode for all attachments etc) but one of the last issues I have is that the auto-increment flag on the tables was not set for some reason. As I have over 250 tables, is there a method to set all the required fields to AI via some SQL script someone has? Kind of not looking forward to the RSI :)
Title: Re: Setting AutoIncrement on tables after importing
Post by: vii on April 24, 2018, 01:07:02 AM
How did you export the tables when you saved the old site's db data? A default export using phpMyAdmin on my machine includes the AUTO_INCREMENT value at the end of the CREATE TABLE query. Is it present in yours?
Title: Re: Setting AutoIncrement on tables after importing
Post by: 6Dasher on April 24, 2018, 08:23:09 AM
The backup is over 800mb, so when I try to open it in an editor it just hangs. I made a simple export and imported it using BigDump.
Title: Re: Setting AutoIncrement on tables after importing
Post by: Kindred on April 24, 2018, 08:48:20 AM
well, something didn;t import correctly...


the command is ALTER TABLE tbl AUTO_INCREMENT = 100;
however...   you will not, yo have to specify the restart number for the autoincrement...  which, in an existing set of tables, means that you have to determine what the existing top number is.

I'd suggest re-trying the export/import process again instead
Title: Re: Setting AutoIncrement on tables after importing
Post by: 6Dasher on April 24, 2018, 12:30:11 PM
Yeah, doing a new export/import would be the way.

I have the autoincrement value checked in the export UI, so not sure what is going wrong.
Title: Re: Setting AutoIncrement on tables after importing
Post by: 6Dasher on April 24, 2018, 12:55:17 PM
OK, I give up. I did several backups and they all give errors when I start up BigDump.

Is there seriously no guide as to what phpmyadmin settings you need for an export? The search on this site is rubbish as there are so many hits in the results that have no information at all. Am I really the only person to want to backup my database? The SMF export is bogus, you eed bigdump to import, it's all starting to sound like this is all just an afterthought as SMF?

Just pissed that something that should be so simple is taking more time and energy than installing the complete forum with mods/themes/settings.
Title: Re: Setting AutoIncrement on tables after importing
Post by: Kindred on April 24, 2018, 02:02:42 PM
I just use the default options for export from phpmyadmin or cpanel.

for the automated database backups, again, I just use the default options.

in none of those three cases have I ever had any issues...


So, no... there has never actually been any need to make a list of settings since I have never seen anyone have this issue before.
Title: Re: Setting AutoIncrement on tables after importing
Post by: 6Dasher on April 24, 2018, 03:21:09 PM
That is what you would think, but for some reason it will not work for me. Hence the hair pulling sensation :)

I got it to work somehow, don't ask me how, after about 12 attempts and a hard slam on the keyboard.
Title: Re: Setting AutoIncrement on tables after importing
Post by: GigaWatt on April 24, 2018, 05:26:31 PM
@Kindred: The default options don't work with my host. Actually, I only had to change one setting in phpMyAdmin.

@6Dasher: Try using compression when exporting. My database is about 7 times smaller than yours, but nevertheless, my host's phpMyAdmin couldn't export the database. Try using zip compression to export the database. In my case, it works both with zip and gzip, but I'd go with zip first and if it doesn't work, try gzip. In most cases, it reduces the size 6 or 7 times (with zip).