News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Cannot restore SMF database after server transfer

Started by Artimidor, November 04, 2006, 07:47:35 AM

Previous topic - Next topic

Artimidor

I've changed servers and reinstalled SMF 1.3 again on the new server. I saved the data of the source database (the important stuff only, no table structures) and tried to import it - however, I get confronted with the following error message:

Quote# --------------------------------------------------------
#
# Dumping data in `dev_board_permissions`
#
INSERT INTO `dev_board_permissions` (

`ID_GROUP` ,
`ID_BOARD` ,
`permission` ,
`addDeny`
)
VALUES (
-1, 0, 'poll_view', 1
), ( 0, 0, 'remove_own', 1 ) , ( 0, 0, 'lock_own', 1 ) , ( 0, 0, 'mark_any_notify', 1 ) , ( 0, 0, 'mark_notify', 1 ) , ( 0, 0, 'modify_own', 1 ) , ( 0, 0, 'poll_add_own', 1 ) , ( 0, 0, 'poll_edit_own', 1 ) , ( 0, 0, 'poll_lock_own', 1 ) , ( 0, 0, 'poll_post', 1 ) , ( 0, 0, 'poll_view', 1 ) , ( 0, 0, 'poll_vote', 1 ) , ( 0, 0, 'post_attachment', 1 ) , ( 0, 0, 'post_new', 1 ) , ( 0, 0, 'post_reply_any', 1 ) , ( 0, 0, 'post_reply_own', 1 ) , ( 0, 0, 'delete_own', 1 ) , ( 0, 0, 'report_any', 1 ) , ( 0, 0, 'send_topic', 1 ) , ( 0, 0, 'view_attachments', 1 ) , ( 2, 0, 'moderate_board', 1 ) , ( 2, 0, 'post_new', 1 ) , ( 2, 0, 'post_reply_own', 1 ) , ( 2, 0, 'post_reply_any', 1 ) , ( 2, 0, 'poll_post', 1 ) , ( 2, 0, 'poll_add_any', 1 ) , ( 2, 0, 'poll_remove_any', 1 ) , ( 2, 0, 'poll_view', 1 ) , ( 2, 0, 'poll_vote', 1 ) , ( 2, 0, 'poll_edit_any', 1 ) , ( 2, 0, 'report_any', 1 ) , ( 2, 0, 'lock_own', 1 ) , ( 2, 0, 'send_topic', 1 ) , ( 2, 0, 'mark_any_notify', 1 ) , ( 2, 0, 'mark_notify', 1 ) , ( 2, 0, 'delete_own', 1 ) , ( 2, 0, 'modify_own', 1 ) , ( 2, 0, 'make_sticky', 1 ) , ( 2, 0, 'lock_any', 1 ) , ( 2, 0, 'remove_any', 1 ) , ( 2, 0, 'move_any', 1 ) , ( 2, 0, 'merge_any', 1 ) , ( 2, 0, 'split_any', 1 ) , ( 2, 0, 'delete_any', 1 ) , ( 2, 0, 'modify_any', 1 ) , ( 3, 0, 'moderate_board', 1 ) , ( 3, 0, 'post_new', 1 ) , ( 3, 0, 'post_reply_own', 1 ) , ( 3, 0, 'post_reply_any', 1 ) , ( 3, 0, 'poll_post', 1 ) , ( 3, 0, 'poll_add_own', 1 ) , ( 3, 0, 'poll_remove_any', 1 ) , ( 3, 0, 'poll_view', 1 ) , ( 3, 0, 'poll_vote', 1 ) , ( 3, 0, 'report_any', 1 ) , ( 3, 0, 'lock_own', 1 ) , ( 3, 0, 'send_topic', 1 ) , ( 3, 0, 'mark_any_notify', 1 ) , ( 3, 0, 'mark_notify', 1 ) , ( 3, 0, 'delete_own', 1 ) , ( 3, 0, 'modify_own', 1 ) , ( 3, 0, 'make_sticky', 1 ) , ( 3, 0, 'lock_any', 1 ) , ( 3, 0, 'remove_any', 1 ) , ( 3, 0, 'move_any', 1 ) , ( 3, 0, 'merge_any', 1 ) , ( 3, 0, 'split_any', 1 ) , ( 3, 0, 'delete_any', 1 ) , ( 3, 0, 'modify_any', 1 ) , ( 15, 0, 'send_topic', 1 ) , ( 15, 0, 'view_attachments', 1 ) , ( 15, 0, 'mark_notify', 1 ) , ( 15, 0, 'mark_any_notify', 1 ) , ( 15, 0, 'poll_remove_own', 1 ) , ( 15, 0, 'poll_lock_own', 1 ) , ( 15, 0, 'poll_edit_own', 1 ) , ( 15, 0, 'poll_add_own', 1 ) , ( 15, 0, 'poll_post', 1 ) , ( 15, 0, 'poll_vote', 1 ) , ( 15, 0, 'poll_view', 1 ) , ( 15, 0, 'report_any', 1 ) , ( 15, 0, 'modify_own', 1 ) , ( 15, 0, 'delete_own', 1 ) , ( 15, 0, 'post_reply_any', 1 ) , ( 15, 0, 'post_reply_own', 1 ) , (
-1, 0, 'post_new', 1
), (
-1, 0, 'post_reply_own', 1
), (
-1, 0, 'post_reply_any', 1
), (
-1, 0, 'poll_post', 1
), ( 15, 0, 'move_own', 1 ) , ( 15, 0, 'post_new', 1 ) , ( 15, 0, 'post_attachment', 1 ) , ( 16, 0, 'delete_own', 1 ) , ( 16, 0, 'mark_any_notify', 1 ) , ( 16, 0, 'mark_notify', 1 ) , ( 16, 0, 'modify_own', 1 ) , ( 16, 0, 'move_own', 1 ) , ( 16, 0, 'poll_add_own', 1 ) , ( 16, 0, 'poll_edit_own', 1 ) , ( 16, 0, 'poll_lock_own', 1 ) , ( 16, 0, 'poll_post', 1 ) , ( 16, 0, 'poll_remove_own', 1 ) , ( 16, 0, 'poll_view', 1 ) , ( 16, 0, 'poll_vote', 1 ) , ( 16, 0, 'post_attachment', 1 ) , ( 16, 0, 'post_new', 1 ) , ( 16, 0, 'post_reply_any', 1 ) , ( 16, 0, 'post_reply_own', 1 ) , ( 16, 0, 'report_any', 1 ) , ( 16, 0, 'send_topic', 1 ) , ( 16, 0, 'view_attachments', 1 ) ;

MySQL said: 

#1062 - Duplicate entry '-1-0-poll_view' for key 1

Does anyone have advice what I could do now?
Artimidor

Oldiesmann

You need to empty out the SMF tables before you import the new data.

In phpMyAdmin, scroll down to the bottom of the page that lists all the tables in your database, check the box to select all, then choose "TRUNCATE" from the "With selected" list. If you have more than one forum installed on there you will only need to check the box next to each table that you want to empty.

Artimidor

Yeah, I finally managed it... Phew...  ;D

Next time I guess I should export the whole database, table structures included, then the tables are dropped and added again, right?

I also made the experience that it is essential while importing not to leave any possibilitiy open for someone to enter the board. Obviously some sort of search engine tried to access, thus something was written in the log file - and *bang* 25 MBs of import data quit again in the middle of it because of another duplicate key. Had to rename the index file, then it all worked perfectly again.
Artimidor

Advertisement: