You mean the table that isn't empty? Make sure you don't have any calendars and events if you want to retain keys.I cant find the table btw.
If you're retaining keys, the calendar must be empty or else you'll run in to duplicate key issues (i.e. you have an event in vBulletin with the ID of 1 but you also have an event in my add-on with an ID of 1).Also: why must it be empty?
IMHO this is not a good method. For example the standard in XenForo and XFMG importers is that you can overwrite data when retaining ID's. I have tested dozens of importers and only a few did not overwrite. The issue that come with importers that do not overwrite are:If you're retaining keys, the calendar must be empty or else you'll run in to duplicate key issues (i.e. you have an event in vBulletin with the ID of 1 but you also have an event in my add-on with an ID of 1).
nf_calendar is the prefix, system_must_be_empty_before_importing is the rest of the phrase.I mean there is no nf_calendar_system table. Maybe I am interpreting the phrase wrong.
Both standard XenForo and XFMG importers do the same thing. For example, XFMG importers will throw a warning if you've got media items and want to retain your keys.IMHO this is not a good method. For example the standard in XenForo and XFMG importers is that you can overwrite data when retaining ID's. I have tested dozens of importers and only a few did not overwrite. The issue that come with importers that do not overwrite are:
- after each import test, you need to clear the database. Even if it only requires a small adjustment. For example by uninstall & reinstall. For a big board this is a drag. This makes it really time intensive to test and hard to find the details of import data corruption issues.
- there is no way to do incremental import testing.
public function retainKeysReset()
{
$db = XenForo_Application::getDb();
$mediaCount = $db->fetchOne('
SELECT COUNT(*)
FROM xengallery_media
');
if ($mediaCount)
{
throw new XenForo_Exception(new XenForo_Phrase('xengallery_gallery_must_be_empty_before_importing'), true);
}
}
TRUNCATE TABLE xf_nf_calendar_event;
TRUNCATE TABLE xf_nf_event_calendar;
MySQL returned an empty result set (i.e. zero rows). (Query took 0.0108 seconds.)That'll empty all rows in the event and calendar tables.
MySQL returning an empty result for truncation is normal: MySQL :: MySQL 8.0 Reference Manual :: 13.1.34 TRUNCATE TABLE SyntaxMySQL returned an empty result set (i.e. zero rows). (Query took 0.0108 seconds.)
For both queries.
But the error is gone.
I see that event tags are kept. How do I remove those?That'll empty all rows in the event and calendar tables.
If doing that, you should also probably ...TRUNCATE TABLE xf_nf_calendar_event;
TRUNCATE TABLE xf_nf_event_calendar;
TRUNCATE TABLE xf_nf_calendar_event_read;