configuration parameter DBWriter.MaxRecordsPerTransaction added to database
[public/netxms.git] / src / server / tools / nxdbmgr / upgrade_v30.cpp
1 /*
2 ** nxdbmgr - NetXMS database manager
3 ** Copyright (C) 2004-2017 Victor Kirhenshtein
4 **
5 ** This program is free software; you can redistribute it and/or modify
6 ** it under the terms of the GNU General Public License as published by
7 ** the Free Software Foundation; either version 2 of the License, or
8 ** (at your option) any later version.
9 **
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details.
14 **
15 ** You should have received a copy of the GNU General Public License
16 ** along with this program; if not, write to the Free Software
17 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 **
19 ** File: upgrade_v30.cpp
20 **
21 **/
22
23 #include "nxdbmgr.h"
24
25 /**
26 * Upgrade from 30.8 to 30.9 (changes also included into 22.2)
27 */
28 static bool H_UpgradeFromV8()
29 {
30 if (GetSchemaLevelForMajorVersion(22) < 2)
31 {
32 CHK_EXEC(CreateConfigParam(_T("DBWriter.MaxRecordsPerTransaction"), _T("1000"), _T("Maximum number of records per one transaction for delayed database writes."), 'I', true, true, false, false));
33 CHK_EXEC(SetSchemaLevelForMajorVersion(22, 2));
34 }
35 CHK_EXEC(SetMinorSchemaVersion(9));
36 return true;
37 }
38
39 /**
40 * Upgrade from 30.7 to 30.8 (changes also included into 22.1)
41 */
42 static bool H_UpgradeFromV7()
43 {
44 if (GetSchemaLevelForMajorVersion(22) < 1)
45 {
46 int count = ConfigReadInt(_T("NumberOfDataCollectors"), 250);
47 TCHAR value[64];
48 _sntprintf(value, 64,_T("%d"), std::max(250, count));
49 CHK_EXEC(CreateConfigParam(_T("DataCollector.ThreadPool.BaseSize"), _T("10"), _T("Base size for data collector thread pool."), 'I', true, true, false, false));
50 CHK_EXEC(CreateConfigParam(_T("DataCollector.ThreadPool.MaxSize"), value, _T("Maximum size for data collector thread pool."), 'I', true, true, false, false));
51 CHK_EXEC(SQLQuery(_T("UPDATE config SET default_value='250' WHERE var_name='DataCollector.ThreadPool.MaxSize'")));
52 CHK_EXEC(SQLQuery(_T("DELETE FROM config WHERE var_name='NumberOfDataCollectors'")));
53 CHK_EXEC(SetSchemaLevelForMajorVersion(22, 1));
54 }
55 CHK_EXEC(SetMinorSchemaVersion(8));
56 return true;
57 }
58
59 /**
60 * Upgrade from 30.6 to 30.7 (changes also included into 21.4)
61 */
62 static bool H_UpgradeFromV6()
63 {
64 if (GetSchemaLevelForMajorVersion(21) < 4)
65 {
66 DB_RESULT hResult = DBSelect(g_hCoreDB, _T("SELECT access_rights,object_id FROM acl WHERE user_id=-2147483647")); // Get group Admins object acl
67 if (hResult != NULL)
68 {
69 DB_STATEMENT hStmt = DBPrepare(g_hCoreDB, _T("UPDATE acl SET access_rights=? WHERE user_id=-2147483647 AND object_id=? "));
70 if (hStmt != NULL)
71 {
72 int nRows = DBGetNumRows(hResult);
73 UINT32 rights;
74 for(int i = 0; i < nRows; i++)
75 {
76 rights = DBGetFieldULong(hResult, i, 0);
77 if (rights & OBJECT_ACCESS_READ)
78 {
79 rights |= (OBJECT_ACCESS_READ_AGENT | OBJECT_ACCESS_READ_SNMP | OBJECT_ACCESS_SCREENSHOT);
80 DBBind(hStmt, 1, DB_SQLTYPE_INTEGER, rights);
81 DBBind(hStmt, 2, DB_SQLTYPE_INTEGER, DBGetFieldULong(hResult, i, 1));
82
83 if (!SQLExecute(hStmt))
84 {
85 if (!g_bIgnoreErrors)
86 {
87 DBFreeStatement(hStmt);
88 DBFreeResult(hResult);
89 return FALSE;
90 }
91 }
92 }
93 }
94
95 DBFreeStatement(hStmt);
96 }
97 else if (!g_bIgnoreErrors)
98 return FALSE;
99 DBFreeResult(hResult);
100 }
101 else if (!g_bIgnoreErrors)
102 return false;
103 CHK_EXEC(SetSchemaLevelForMajorVersion(21, 4));
104 }
105 CHK_EXEC(SetMinorSchemaVersion(7));
106 return true;
107 }
108
109 /**
110 * Upgrade from 30.5 to 30.6 (changes also included into 21.3)
111 */
112 static bool H_UpgradeFromV5()
113 {
114 if (GetSchemaLevelForMajorVersion(21) < 3)
115 {
116 static const TCHAR *batch =
117 _T("UPDATE nodes SET fail_time_snmp=0 WHERE fail_time_snmp IS NULL\n")
118 _T("UPDATE nodes SET fail_time_agent=0 WHERE fail_time_agent IS NULL\n")
119 _T("<END>");
120 CHK_EXEC(SQLBatch(batch));
121
122 CHK_EXEC(DBSetNotNullConstraint(g_hCoreDB, _T("nodes"), _T("fail_time_snmp")));
123 CHK_EXEC(DBSetNotNullConstraint(g_hCoreDB, _T("nodes"), _T("fail_time_agent")));
124 CHK_EXEC(SetSchemaLevelForMajorVersion(21, 3));
125 }
126 CHK_EXEC(SetMinorSchemaVersion(6));
127 return true;
128 }
129
130 /**
131 * Upgrade from 30.4 to 30.5 (changes also included into 21.2)
132 */
133 static bool H_UpgradeFromV4()
134 {
135 if (GetSchemaLevelForMajorVersion(21) < 2)
136 {
137 static const TCHAR *batch =
138 _T("ALTER TABLE nodes ADD fail_time_snmp integer\n")
139 _T("ALTER TABLE nodes ADD fail_time_agent integer\n")
140 _T("<END>");
141 CHK_EXEC(SQLBatch(batch));
142 CHK_EXEC(SetSchemaLevelForMajorVersion(21, 2));
143 }
144 CHK_EXEC(SetMinorSchemaVersion(5));
145 return true;
146 }
147
148 /**
149 * Move object flags from old to new tables
150 */
151 static BOOL MoveFlagsFromOldTables(const TCHAR *tableName)
152 {
153 TCHAR query[256];
154 _sntprintf(query, 256, _T("SELECT id,flags FROM %s"), tableName);
155 DB_RESULT hResult = DBSelect(g_hCoreDB, query);
156 DB_STATEMENT hStmt = DBPrepare(g_hCoreDB, _T("UPDATE object_properties SET flags=? WHERE object_id=?"));
157 if (hResult != NULL)
158 {
159 if (hStmt != NULL)
160 {
161 int nRows = DBGetNumRows(hResult);
162 for(int i = 0; i < nRows; i++)
163 {
164 DBBind(hStmt, 1, DB_SQLTYPE_INTEGER, DBGetFieldULong(hResult, i, 1));
165 DBBind(hStmt, 2, DB_SQLTYPE_INTEGER, DBGetFieldULong(hResult, i, 0));
166
167 if (!SQLExecute(hStmt))
168 {
169 if (!g_bIgnoreErrors)
170 {
171 DBFreeStatement(hStmt);
172 DBFreeResult(hResult);
173 return FALSE;
174 }
175 }
176 }
177 DBFreeStatement(hStmt);
178 }
179 else if (!g_bIgnoreErrors)
180 {
181 return FALSE;
182 }
183 DBFreeResult(hResult);
184 }
185 else if (!g_bIgnoreErrors)
186 {
187 return FALSE;
188 }
189
190 CHK_EXEC(DBDropColumn(g_hCoreDB, tableName, _T("flags")));
191 return TRUE;
192 }
193
194 /**
195 * Move single flag
196 */
197 inline void MoveFlag(UINT32 oldVar, UINT32 *newVar, UINT32 oldFlag, UINT32 newFlag)
198 {
199 *newVar |= ((oldVar & oldFlag) != 0) ? newFlag : 0;
200 }
201
202 /**
203 * Move node flags
204 */
205 static void MoveNodeFlags(UINT32 oldFlag, UINT32 *flags)
206 {
207 MoveFlag(oldFlag, flags, 0x10000000, DCF_DISABLE_STATUS_POLL);
208 MoveFlag(oldFlag, flags, 0x20000000, DCF_DISABLE_CONF_POLL);
209 MoveFlag(oldFlag, flags, 0x80000000, DCF_DISABLE_DATA_COLLECT);
210 MoveFlag(oldFlag, flags, 0x00000080, NF_REMOTE_AGENT);
211 MoveFlag(oldFlag, flags, 0x00400000, NF_DISABLE_DISCOVERY_POLL);
212 MoveFlag(oldFlag, flags, 0x00800000, NF_DISABLE_TOPOLOGY_POLL);
213 MoveFlag(oldFlag, flags, 0x01000000, NF_DISABLE_SNMP);
214 MoveFlag(oldFlag, flags, 0x02000000, NF_DISABLE_NXCP);
215 MoveFlag(oldFlag, flags, 0x04000000, NF_DISABLE_ICMP);
216 MoveFlag(oldFlag, flags, 0x08000000, NF_FORCE_ENCRYPTION);
217 MoveFlag(oldFlag, flags, 0x40000000, NF_DISABLE_ROUTE_POLL);
218 }
219
220 /**
221 * Move node capabilities flags
222 */
223 static void MoveNodeCapabilities(UINT32 oldFlag, UINT32 *capabilities)
224 {
225 MoveFlag(oldFlag, capabilities, 0x00000001, NC_IS_SNMP);
226 MoveFlag(oldFlag, capabilities, 0x00000002, NC_IS_NATIVE_AGENT);
227 MoveFlag(oldFlag, capabilities, 0x00000004, NC_IS_BRIDGE);
228 MoveFlag(oldFlag, capabilities, 0x00000008, NC_IS_ROUTER);
229 MoveFlag(oldFlag, capabilities, 0x00000010, NC_IS_LOCAL_MGMT);
230 MoveFlag(oldFlag, capabilities, 0x00000020, NC_IS_PRINTER);
231 MoveFlag(oldFlag, capabilities, 0x00000040, NC_IS_OSPF);
232 MoveFlag(oldFlag, capabilities, 0x00000100, NC_IS_CPSNMP);
233 MoveFlag(oldFlag, capabilities, 0x00000200, NC_IS_CDP);
234 MoveFlag(oldFlag, capabilities, 0x00000400, NC_IS_NDP);
235 MoveFlag(oldFlag, capabilities, 0x00000800, NC_IS_LLDP);
236 MoveFlag(oldFlag, capabilities, 0x00001000, NC_IS_VRRP);
237 MoveFlag(oldFlag, capabilities, 0x00002000, NC_HAS_VLANS);
238 MoveFlag(oldFlag, capabilities, 0x00004000, NC_IS_8021X);
239 MoveFlag(oldFlag, capabilities, 0x00008000, NC_IS_STP);
240 MoveFlag(oldFlag, capabilities, 0x00010000, NC_HAS_ENTITY_MIB);
241 MoveFlag(oldFlag, capabilities, 0x00020000, NC_HAS_IFXTABLE);
242 MoveFlag(oldFlag, capabilities, 0x00040000, NC_HAS_AGENT_IFXCOUNTERS);
243 MoveFlag(oldFlag, capabilities, 0x00080000, NC_HAS_WINPDH);
244 MoveFlag(oldFlag, capabilities, 0x00100000, NC_IS_WIFI_CONTROLLER);
245 MoveFlag(oldFlag, capabilities, 0x00200000, NC_IS_SMCLP);
246 }
247
248 /**
249 * Move node state flags
250 */
251 static void MoveNodeState(UINT32 oldRuntime, UINT32 *state)
252 {
253 MoveFlag(oldRuntime, state, 0x000004, DCSF_UNREACHABLE);
254 MoveFlag(oldRuntime, state, 0x000008, NSF_AGENT_UNREACHABLE);
255 MoveFlag(oldRuntime, state, 0x000010, NSF_SNMP_UNREACHABLE);
256 MoveFlag(oldRuntime, state, 0x000200, NSF_CPSNMP_UNREACHABLE);
257 MoveFlag(oldRuntime, state, 0x008000, DCSF_NETWORK_PATH_PROBLEM);
258 MoveFlag(oldRuntime, state, 0x020000, NSF_CACHE_MODE_NOT_SUPPORTED);
259 }
260
261 /**
262 * Move sensor state flags
263 */
264 static void MoveSensorState(UINT32 oldFlag, UINT32 oldRuntime, UINT32 *status)
265 {
266 MoveFlag(oldFlag, status, 0x00000001, SSF_PROVISIONED);
267 MoveFlag(oldFlag, status, 0x00000002, SSF_REGISTERED);
268 MoveFlag(oldFlag, status, 0x00000004, SSF_ACTIVE);
269 MoveFlag(oldFlag, status, 0x00000008, SSF_CONF_UPDATE_PENDING);
270 MoveFlag(oldRuntime, status, 0x000004, DCSF_UNREACHABLE);
271 }
272
273 /**
274 * Upgrade from 30.3 to 30.4
275 */
276 static bool H_UpgradeFromV3()
277 {
278 static const TCHAR *batch =
279 _T("ALTER TABLE object_properties ADD flags integer null\n")
280 _T("ALTER TABLE object_properties ADD state integer null\n")
281 _T("ALTER TABLE nodes ADD capabilities integer null\n")
282 _T("UPDATE object_properties set flags=0,state=0\n")
283 _T("<END>");
284 CHK_EXEC(SQLBatch(batch));
285
286 //move flags from old tables to the new one
287 CHK_EXEC(MoveFlagsFromOldTables(_T("interfaces")));
288 CHK_EXEC(MoveFlagsFromOldTables(_T("templates")));
289 CHK_EXEC(MoveFlagsFromOldTables(_T("chassis")));
290 CHK_EXEC(MoveFlagsFromOldTables(_T("object_containers")));
291 CHK_EXEC(MoveFlagsFromOldTables(_T("network_maps")));
292 //create special behavior for node and sensor, cluster
293 //node
294 DB_RESULT hResult = DBSelect(g_hCoreDB, _T("SELECT id,runtime_flags FROM nodes"));
295 DB_STATEMENT stmtNetObj = DBPrepare(g_hCoreDB, _T("UPDATE object_properties SET flags=?, state=? WHERE object_id=?"));
296 DB_STATEMENT stmtNode = DBPrepare(g_hCoreDB, _T("UPDATE nodes SET capabilities=? WHERE id=?"));
297 if (hResult != NULL)
298 {
299 if (stmtNetObj != NULL && stmtNode != NULL)
300 {
301 int nRows = DBGetNumRows(hResult);
302 for(int i = 0; i < nRows; i++)
303 {
304 UINT32 id = DBGetFieldULong(hResult, i, 0);
305 UINT32 oldFlags = 0;
306 UINT32 oldRuntime = DBGetFieldULong(hResult, i, 1);
307 UINT32 flags = 0;
308 UINT32 state = 0;
309 UINT32 capabilities = 0;
310 TCHAR query[256];
311 _sntprintf(query, 256, _T("SELECT node_flags FROM nodes WHERE id=%d"), id);
312 DB_RESULT flagResult = DBSelect(g_hCoreDB, query);
313 if(DBGetNumRows(flagResult) >= 1)
314 {
315 oldFlags = DBGetFieldULong(flagResult, 0, 0);
316 }
317 else
318 {
319 if(!g_bIgnoreErrors)
320 {
321 DBFreeStatement(stmtNetObj);
322 DBFreeStatement(stmtNode);
323 DBFreeResult(hResult);
324 return FALSE;
325 }
326 }
327 MoveNodeFlags(oldFlags, &flags);
328 MoveNodeCapabilities(oldFlags, &capabilities);
329 MoveNodeState(oldRuntime, &state);
330
331 DBBind(stmtNetObj, 1, DB_SQLTYPE_INTEGER, flags);
332 DBBind(stmtNetObj, 2, DB_SQLTYPE_INTEGER, state);
333 DBBind(stmtNetObj, 3, DB_SQLTYPE_INTEGER, id);
334
335 DBBind(stmtNode, 1, DB_SQLTYPE_INTEGER, capabilities);
336 DBBind(stmtNode, 2, DB_SQLTYPE_INTEGER, id);
337
338 if (!(SQLExecute(stmtNetObj)))
339 {
340 if (!g_bIgnoreErrors)
341 {
342 DBFreeStatement(stmtNetObj);
343 DBFreeStatement(stmtNode);
344 DBFreeResult(hResult);
345 return FALSE;
346 }
347 }
348
349 if (!SQLExecute(stmtNode))
350 {
351 if (!g_bIgnoreErrors)
352 {
353 DBFreeStatement(stmtNetObj);
354 DBFreeStatement(stmtNode);
355 DBFreeResult(hResult);
356 return FALSE;
357 }
358 }
359 }
360 DBFreeStatement(stmtNetObj);
361 DBFreeStatement(stmtNode);
362 }
363 else
364 {
365 if(stmtNetObj != NULL)
366 DBFreeStatement(stmtNetObj);
367
368 if(stmtNode != NULL)
369 DBFreeStatement(stmtNode);
370 if (!g_bIgnoreErrors)
371 {
372 return FALSE;
373 }
374 }
375 DBFreeResult(hResult);
376 }
377 CHK_EXEC(DBDropColumn(g_hCoreDB, _T("nodes"), _T("runtime_flags")));
378 CHK_EXEC(DBDropColumn(g_hCoreDB, _T("nodes"), _T("node_flags")));
379
380 //sensor
381 hResult = DBSelect(g_hCoreDB, _T("SELECT id,runtime_flags,flags FROM sensors"));
382 DB_STATEMENT stmt = DBPrepare(g_hCoreDB, _T("UPDATE object_properties SET status=? WHERE object_id=?"));
383 if (hResult != NULL)
384 {
385 if (stmt != NULL)
386 {
387 int nRows = DBGetNumRows(hResult);
388 for(int i = 0; i < nRows; i++)
389 {
390 UINT32 status = 0;
391 MoveSensorState(DBGetFieldULong(hResult, i, 2), DBGetFieldULong(hResult, i, 1), &status);
392
393 DBBind(stmt, 1, DB_SQLTYPE_INTEGER, status);
394 DBBind(stmt, 2, DB_SQLTYPE_INTEGER, DBGetFieldULong(hResult, i, 0));
395
396 if (!(SQLExecute(stmt)))
397 {
398 if (!g_bIgnoreErrors)
399 {
400 DBFreeStatement(stmt);
401 DBFreeResult(hResult);
402 return FALSE;
403 }
404 }
405 }
406 DBFreeStatement(stmt);
407 }
408 else if (!g_bIgnoreErrors)
409 {
410 return FALSE;
411 }
412 DBFreeResult(hResult);
413 }
414 CHK_EXEC(DBDropColumn(g_hCoreDB, _T("sensors"), _T("runtime_flags")));
415 CHK_EXEC(DBDropColumn(g_hCoreDB, _T("sensors"), _T("flags")));
416
417 CHK_EXEC(SetMinorSchemaVersion(4));
418 return true;
419 }
420
421 /**
422 * Upgrade from 30.2 to 30.3
423 */
424 static bool H_UpgradeFromV2()
425 {
426 CHK_EXEC(DBDropColumn(g_hCoreDB, _T("event_groups"), _T("range_start")));
427 CHK_EXEC(DBDropColumn(g_hCoreDB, _T("event_groups"), _T("range_end")));
428
429 static const TCHAR *batch =
430 _T("ALTER TABLE event_groups ADD guid varchar(36) null\n")
431 _T("UPDATE event_groups SET guid='04b326c0-5cc0-411f-8587-2836cb87c920' WHERE id=-2147483647\n")
432 _T("UPDATE event_groups SET guid='b61859c6-1768-4a61-a0cf-eed07d688f66' WHERE id=-2147483646\n")
433 _T("<END>");
434 CHK_EXEC(SQLBatch(batch));
435 DBSetNotNullConstraint(g_hCoreDB, _T("event_groups"), _T("guid"));
436
437 CHK_EXEC(SetMinorSchemaVersion(3));
438 return true;
439 }
440
441 /**
442 * Upgrade from 30.1 to 30.2
443 */
444 static bool H_UpgradeFromV1()
445 {
446 static const TCHAR *batch =
447 _T("ALTER TABLE users ADD created integer null\n")
448 _T("ALTER TABLE user_groups ADD created integer null\n")
449 _T("UPDATE users SET created=0\n")
450 _T("UPDATE user_groups SET created=0\n")
451 _T("<END>");
452 CHK_EXEC(SQLBatch(batch));
453 CHK_EXEC(DBSetNotNullConstraint(g_hCoreDB, _T("users"), _T("created")));
454 CHK_EXEC(DBSetNotNullConstraint(g_hCoreDB, _T("user_groups"), _T("created")));
455
456 CHK_EXEC(SetMinorSchemaVersion(2));
457 return true;
458 }
459
460 /**
461 * Upgrade from 30.0 to 30.1
462 */
463 static bool H_UpgradeFromV0()
464 {
465 CHK_EXEC(CreateTable(
466 _T("CREATE TABLE sensors (")
467 _T(" id integer not null,")
468 _T(" proxy_node integer not null,")
469 _T(" flags integer not null,")
470 _T(" mac_address varchar(16) null,")
471 _T(" device_class integer not null,")
472 _T(" vendor varchar(128) null,")
473 _T(" communication_protocol integer not null,")
474 _T(" xml_config varchar(4000) null,")
475 _T(" xml_reg_config varchar(4000) null,")
476 _T(" serial_number varchar(256) null,")
477 _T(" device_address varchar(256) null,")
478 _T(" meta_type varchar(256) null,")
479 _T(" description varchar(512) null,")
480 _T(" last_connection_time integer not null,")
481 _T(" frame_count integer not null,")
482 _T(" signal_strenght integer not null,")
483 _T(" signal_noise integer not null,")
484 _T(" frequency integer not null,")
485 _T(" runtime_flags integer null,")
486 _T("PRIMARY KEY(id))")));
487
488 CHK_EXEC(SetMinorSchemaVersion(1));
489 return true;
490 }
491
492 /**
493 * Upgrade map
494 */
495 static struct
496 {
497 int version;
498 int nextMajor;
499 int nextMinor;
500 bool (* upgradeProc)();
501 } s_dbUpgradeMap[] =
502 {
503 { 8, 30, 9, H_UpgradeFromV8 },
504 { 7, 30, 8, H_UpgradeFromV7 },
505 { 6, 30, 7, H_UpgradeFromV6 },
506 { 5, 30, 6, H_UpgradeFromV5 },
507 { 4, 30, 5, H_UpgradeFromV4 },
508 { 3, 30, 4, H_UpgradeFromV3 },
509 { 2, 30, 3, H_UpgradeFromV2 },
510 { 1, 30, 2, H_UpgradeFromV1 },
511 { 0, 30, 1, H_UpgradeFromV0 },
512 { 0, 0, 0, NULL }
513 };
514
515 /**
516 * Upgrade database to new version
517 */
518 bool MajorSchemaUpgrade_V30()
519 {
520 INT32 major, minor;
521 if (!DBGetSchemaVersion(g_hCoreDB, &major, &minor))
522 return false;
523
524 while((major == 30) && (minor < DB_SCHEMA_VERSION_V30_MINOR))
525 {
526 // Find upgrade procedure
527 int i;
528 for(i = 0; s_dbUpgradeMap[i].upgradeProc != NULL; i++)
529 if (s_dbUpgradeMap[i].version == minor)
530 break;
531 if (s_dbUpgradeMap[i].upgradeProc == NULL)
532 {
533 _tprintf(_T("Unable to find upgrade procedure for version 30.%d\n"), minor);
534 return false;
535 }
536 _tprintf(_T("Upgrading from version 30.%d to %d.%d\n"), minor, s_dbUpgradeMap[i].nextMajor, s_dbUpgradeMap[i].nextMinor);
537 DBBegin(g_hCoreDB);
538 if (s_dbUpgradeMap[i].upgradeProc())
539 {
540 DBCommit(g_hCoreDB);
541 if (!DBGetSchemaVersion(g_hCoreDB, &major, &minor))
542 return false;
543 }
544 else
545 {
546 _tprintf(_T("Rolling back last stage due to upgrade errors...\n"));
547 DBRollback(g_hCoreDB);
548 return false;
549 }
550 }
551 return true;
552 }