MioVisman / FluxBB_by_Visman

My modification of FluxBB
GNU General Public License v2.0
79 stars 13 forks source link

What should I do if I want to migrate an online FluxBB to use this version? #7

Closed void285 closed 6 years ago

void285 commented 6 years ago

Hello, I have a forum runs on the official version with a few mods, and I want to migrate to this version, is it OK if I just make the apache server to use a new path as website directory?

MioVisman commented 6 years ago

First of all make a backup database and forum catalog.

Try to do an upgrade on a copy of the database and forum directory.

The config.php file should be in the include/ directory and looks like this:

<?php

$db_type = ...;
$db_host = ...;
$db_name = ...;
$db_username = ...;
$db_password = ...;
$db_prefix = ...;
$p_connect = ...;

$cookie_name = ...;
$cookie_domain = ...;
$cookie_path = ...;
$cookie_secure = ...;
$cookie_seed = ...;

$salt1 = '';

define('PUN', 1);

//define('PUN_DEBUG', 1);
//define('PUN_SHOW_QUERIES', 1);
define('PUN_MAX_POSTSIZE', 65535);
//define('FORUM_EOL', "\r\n"); // possible values can be PHP_EOL, "\r\n", "\n" or "\r"
//define('FORUM_UA_OFF', 1);
define('FORUM_AJAX_JQUERY', '//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js');
void285 commented 6 years ago

I follow your instruction but encountered with db error, I check the debug info and found there are two tables(online & forum) altered with additional columns.

I made changes to the two tables and build the 8 new tables(pms_new_block / pms_new_posts / pms_new_topics / poll / poll_voted / sec_of_login / smilies / warnings), and the website lead me to the db_upgrade.php page. I have upgraded the website and it works well, thanks!

MioVisman commented 6 years ago

Hmm, the db_update.php file had to start automatically and change the structure of the database -> https://github.com/MioVisman/FluxBB_by_Visman/blob/master/db_update.php#L1827-L2433

void285 commented 6 years ago

That will be nice.

Below are the sql statements I use.

ALTER TABLE online
ADD COLUMN `witt_data` varchar(255) NOT NULL DEFAULT '' AFTER `last_search`;

ALTER TABLE forums
ADD COLUMN `last_topic` varchar(255) NULL DEFAULT NULL AFTER `last_poster`,
ADD COLUMN `no_sum_mess` tinyint(1) NOT NULL DEFAULT 0 AFTER `cat_id`,
ADD COLUMN `parent_forum_id` int(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `no_sum_mess`;
DROP TABLE IF EXISTS `pms_new_block`;
CREATE TABLE `pms_new_block` (
  `bl_id` int(10) unsigned NOT NULL DEFAULT '0',
  `bl_user_id` int(10) unsigned NOT NULL DEFAULT '0',
  KEY `pms_new_block_bl_id_idx` (`bl_id`),
  KEY `pms_new_block_bl_user_id_idx` (`bl_user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

DROP TABLE IF EXISTS `pms_new_posts`;
CREATE TABLE `pms_new_posts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `poster` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `poster_id` int(10) unsigned NOT NULL DEFAULT '1',
  `poster_ip` varchar(39) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `message` text COLLATE utf8mb4_unicode_ci,
  `hide_smilies` tinyint(1) NOT NULL DEFAULT '0',
  `posted` int(10) unsigned NOT NULL DEFAULT '0',
  `edited` int(10) unsigned DEFAULT NULL,
  `edited_by` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `post_new` tinyint(1) NOT NULL DEFAULT '1',
  `topic_id` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `pms_new_posts_topic_id_idx` (`topic_id`),
  KEY `pms_new_posts_multi_idx` (`poster_id`,`topic_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

DROP TABLE IF EXISTS `pms_new_topics`;
CREATE TABLE `pms_new_topics` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `topic` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `starter` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `starter_id` int(10) unsigned NOT NULL DEFAULT '0',
  `to_user` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `to_id` int(10) unsigned NOT NULL DEFAULT '0',
  `replies` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `last_posted` int(10) unsigned NOT NULL DEFAULT '0',
  `last_poster` tinyint(1) NOT NULL DEFAULT '0',
  `see_st` int(10) unsigned NOT NULL DEFAULT '0',
  `see_to` int(10) unsigned NOT NULL DEFAULT '0',
  `topic_st` tinyint(4) NOT NULL DEFAULT '0',
  `topic_to` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `pms_new_topics_multi_idx_st` (`starter_id`,`topic_st`),
  KEY `pms_new_topics_multi_idx_to` (`to_id`,`topic_to`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

DROP TABLE IF EXISTS `poll`;
CREATE TABLE `poll` (
  `tid` int(10) unsigned NOT NULL DEFAULT '0',
  `question` tinyint(4) NOT NULL DEFAULT '0',
  `field` tinyint(4) NOT NULL DEFAULT '0',
  `choice` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `votes` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`tid`,`question`,`field`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

DROP TABLE IF EXISTS `poll_voted`;
CREATE TABLE `poll_voted` (
  `tid` int(10) unsigned NOT NULL,
  `uid` int(10) unsigned NOT NULL,
  `rez` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`tid`,`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

DROP TABLE IF EXISTS `sec_of_login`;
CREATE TABLE `sec_of_login` (
  `form_key` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `form_time` int(10) unsigned NOT NULL DEFAULT '0',
  `form_ip` varchar(39) COLLATE utf8mb4_unicode_ci NOT NULL,
  `form_captcha` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  KEY `sec_of_login_form_key_idx` (`form_key`),
  KEY `sec_of_login_form_time_idx` (`form_time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40000 ALTER TABLE `sec_of_login` DISABLE KEYS */;
INSERT INTO `sec_of_login` VALUES ('48061faabd97040a5a07691349d31a46c8ec8a2d',1537107032,'192.168.99.1','error');
/*!40000 ALTER TABLE `sec_of_login` ENABLE KEYS */;

DROP TABLE IF EXISTS `smilies`;
CREATE TABLE `smilies` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `image` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `text` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `disp_position` tinyint(4) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40000 ALTER TABLE `smilies` DISABLE KEYS */;
INSERT INTO `smilies` VALUES (1,'smile.png',':)',0),(2,'smile.png','=)',1),(3,'neutral.png',':|',2),(4,'neutral.png','=|',3),(5,'sad.png',':(',4),(6,'sad.png','=(',5),(7,'big_smile.png',':D',6),(8,'big_smile.png','=D',7),(9,'yikes.png',':o',8),(10,'yikes.png',':O',9),(11,'wink.png',';)',10),(12,'hmm.png',':/',11),(13,'tongue.png',':P',12),(14,'tongue.png',':p',13),(15,'lol.png',':lol:',14),(16,'mad.png',':mad:',15),(17,'roll.png',':rolleyes:',16),(18,'cool.png',':cool:',17);
/*!40000 ALTER TABLE `smilies` ENABLE KEYS */;

DROP TABLE IF EXISTS `warnings`;
CREATE TABLE `warnings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `poster` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `poster_id` int(10) unsigned NOT NULL DEFAULT '0',
  `posted` int(10) unsigned NOT NULL DEFAULT '0',
  `message` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
void285 commented 6 years ago

But I'm not sure whether there is something left or made wrong.