News:

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

Main Menu

[urgent] XSorbit -> Simple Machines

Started by Synaptic Anarchy, May 12, 2005, 03:49:52 PM

Previous topic - Next topic

Synaptic Anarchy

 :-[ I'm getting really worried about this problem. My friend has a board with www.xsorbit.com [nofollow] which looks remarkably like SMF (which means it's either YaBB SE or SMF). His paid plan covers a certain amount of pageviews a month, and anything over that they start charging him heavily. With his rapidly-swelling membership, and some jokers running scripts that generate pageviews on his site at a phenomenal rate, he is tired of this and wants to switch. He has over 800 members and 20k+ topics, though, so starting over from scratch is not an option I can get him to accept.

Given the similarities between the two forums, I decided to import the database from the original to a new forum. This was the only real option I had, and an excellent tutorial for this can be found here on this site.

However, I quickly ran into problems, as I found the following restrictions have left me with my hands tied:

-The board owner does not have access to his own files
-The board owner does not have access to phpMyAdmin (if it is even installed on his server)
-I do not have database-creation permissions on my host
-I cannot import a 22MB SQL file into phpMyAdmin (on my host? Or is this a general rule?)
-I am running into errors such as
Unknown column 'b.override_theme' in 'field list'
on attempted board and topic views, and various minor SQL errors within the old database while loading it in a piece at a time.

I cannot follow your recommended proceedure, and it's taking an inexcusably long time to complete this process - and I'm getting errors on top of that!

Right now the option I see is to write a PHP script to run the necessary SQL queries all at once and work from there. Any help you can offer with this, or another painless means of getting this database imported, and helping me with the errors I'm likely to encounter, would b greatly appreciated.

Thank yo for your time,
Shaun M. Tebo

[edit]The reason for the urgency is that the old board is going to be deleted by XSorbit soon.

Synaptic Anarchy

#1

<?php 
define
('IN_PHPBB'true); 
$phpbb_root_path './'

$i 0;
while ( !
file_exists($phpbb_root_path 'extension.inc') && ($i++ < 4) )
{
$phpbb_root_path .= '../';
}
if ( 
$i )
{
   message_die(GENERAL_MESSAGE'Unable to find extension.inc, terminating. Please move this file into your main/"root" phpbb directory and try again.'); 
}

include(
$phpbb_root_path 'extension.inc'); 
include(
$phpbb_root_path 'common.'.$phpEx); 

// 
// Start session management 
// 
$userdata session_pagestart($user_ipPAGE_INDEX); 
init_userprefs($userdata); 
// 
// End session management 
// 

if( !$userdata['session_logged_in'] ) 

redirect(append_sid("login.$phpEx?redirect=sql_install.$phpEx"true));


if( 
$userdata['user_level'] != ADMIN 

   message_die(GENERAL_MESSAGE'You are not authorised to access this page'); 


$page_title 'Installing Cash Mod v 2.2.2 Tables, Updating Configuration settings'
include(
$phpbb_root_path 'includes/page_header.'.$phpEx); 

print<<<DELIM
<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">
  <tr>
    <th class="thHead">Updating the database</th>
  </tr>
  <tr>
    <td>
      <span class="genmed">
        <ul type="circle">

DELIM;

$current_time time();

switch ( 
SQL_LAYER )
{
case 'msaccess':
break;
case 'postgresql':
break;
case 'mssql':
case 'mssql-odbc':
      $sql = array( 
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_disable',0);",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_display_after_posts',1);",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_post_message','You earned %s for that post');",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_disable_spam_num',10);",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_disable_spam_time',24);",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_disable_spam_message','You have exceeded the alloted amount of posts and will not earn anything for your post');",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_installed','yes');",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_version','2.2.2');",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('points_name','Points');",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_adminnavbar','1');",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_adminbig','0');",


   "CREATE TABLE [userid].[{$table_prefix}cash] (
[cash_id] [int] IDENTITY (1, 1) NOT NULL,
[cash_order] [int] NOT NULL,
[cash_settings] [int] NOT NULL,
[cash_dbfield] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[cash_name] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[cash_default] [int] NOT NULL,
[cash_decimals] [int] NOT NULL,
[cash_imageurl] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[cash_exchange] [int] NOT NULL,
[cash_perpost] [int] NOT NULL,
[cash_postbonus] [int] NOT NULL,
[cash_perreply] [int] NOT NULL,
[cash_maxearn] [int] NOT NULL,
[cash_perpm] [int] NOT NULL,
[cash_perchar] [int] NOT NULL,
[cash_allowance] [int] NOT NULL,
[cash_allowanceamount] [int] NOT NULL,
[cash_allowancetime] [int] NOT NULL,
[cash_allowancenext] [int] NOT NULL,
[cash_forumlist] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]"
,
   "ALTER TABLE [userid].[{$table_prefix}cash] WITH NOCHECK ADD 
CONSTRAINT [PK_
{$table_prefix}cash] PRIMARY KEY CLUSTERED 

[cash_id] 
) ON [PRIMARY]"

   "ALTER TABLE [userid].[{$table_prefix}cash] WITH NOCHECK ADD 
CONSTRAINT [DF_
{$table_prefix}cash_cash_order]           DEFAULT (0) FOR [cash_order], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_settings]        DEFAULT (3313) FOR [cash_settings], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_dbfield]         DEFAULT ('user_cash') FOR [cash_dbfield], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_name]            DEFAULT ('cash') FOR [cash_name], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_default]         DEFAULT (0) FOR [cash_default], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_decimals]        DEFAULT (0) FOR [cash_decimals], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_imageurl]        DEFAULT (' ') FOR [cash_imageurl], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_exchange]        DEFAULT (1) FOR [cash_exchange], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_perpost]         DEFAULT (25) FOR [cash_perpost], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_postbonus]       DEFAULT (2) FOR [cash_postbonus], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_perreply]        DEFAULT (25) FOR [cash_perreply], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_maxearn]         DEFAULT (75) FOR [cash_maxearn], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_perpm]           DEFAULT (0) FOR [cash_perpm], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_perchar]         DEFAULT (20) FOR [cash_perchar], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_allowance]       DEFAULT (0) FOR [cash_allowance], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_allowanceamount] DEFAULT (0) FOR [cash_allowanceamount], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_allowancetime]   DEFAULT (2) FOR [cash_allowancetime], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_allowancenext]   DEFAULT (0) FOR [cash_allowancenext], 
CONSTRAINT [DF_
{$table_prefix}cash_cash_forumlist]       DEFAULT (' ') FOR [cash_forumlist]"


   "CREATE TABLE [userid].[{$table_prefix}cash_events] (
[event_name] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[event_data] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
) ON [PRIMARY]"
,
   "ALTER TABLE [userid].[{$table_prefix}cash_events] WITH NOCHECK ADD 
CONSTRAINT [PK_
{$table_prefix}cash_events] PRIMARY KEY CLUSTERED 

[event_name] 
) ON [PRIMARY]"

   "ALTER TABLE [userid].[{$table_prefix}cash_events] WITH NOCHECK ADD 
CONSTRAINT [DF_
{$table_prefix}cash_events_event_name]    DEFAULT (' ') FOR [event_name], 
CONSTRAINT [DF_
{$table_prefix}cash_events_event_data]    DEFAULT (' ') FOR [event_data]"


   "CREATE TABLE [userid].[{$table_prefix}cash_exchange] ( 
[ex_cash_id1] [int] NOT NULL , 
[ex_cash_id2] [int] NOT NULL , 
[ex_cash_enabled] [int] NOT NULL 
) ON [PRIMARY]"

   "ALTER TABLE [userid].[{$table_prefix}cash_exchange] WITH NOCHECK ADD 
CONSTRAINT [PK_
{$table_prefix}cash_exchange] PRIMARY KEY CLUSTERED 

[ex_cash_id1], 
[ex_cash_id2] 
) ON [PRIMARY]"

   "ALTER TABLE [userid].[{$table_prefix}cash_exchange] WITH NOCHECK ADD 
CONSTRAINT [DF_
{$table_prefix}cash_exchange_cash_enabled] DEFAULT (1) FOR [ex_cash_enabled]",


   "CREATE TABLE [userid].[{$table_prefix}cash_groups] (
[group_id] [int] NOT NULL,
[group_type] [int] NOT NULL,
[cash_id] [int] NOT NULL,
[cash_perpost] [int] NOT NULL,
[cash_postbonus] [int] NOT NULL,
[cash_perreply] [int] NOT NULL,
[cash_perchar] [int] NOT NULL,
[cash_maxearn] [int] NOT NULL,
[cash_perpm] [int] NOT NULL,
[cash_allowance] [int] NOT NULL,
[cash_allowanceamount] [int] NOT NULL,
[cash_allowancetime] [int] NOT NULL,
[cash_allowancenext] [int] NOT NULL,
) ON [PRIMARY]"

   "ALTER TABLE [userid].[{$table_prefix}cash_groups] WITH NOCHECK ADD 
CONSTRAINT [PK_
{$table_prefix}cash_groups] PRIMARY KEY CLUSTERED 

[group_id],[group_type],[cash_id] 
) ON [PRIMARY]"

   "ALTER TABLE [userid].[{$table_prefix}cash_groups] WITH NOCHECK ADD 
CONSTRAINT [DF_
{$table_prefix}cash_groups_cash_perpost]         DEFAULT (0) FOR [cash_perpost], 
CONSTRAINT [DF_
{$table_prefix}cash_groups_cash_postbonus]       DEFAULT (0) FOR [cash_postbonus], 
CONSTRAINT [DF_
{$table_prefix}cash_groups_cash_perreply]        DEFAULT (0) FOR [cash_perreply], 
CONSTRAINT [DF_
{$table_prefix}cash_groups_cash_perchar]         DEFAULT (0) FOR [cash_perchar], 
CONSTRAINT [DF_
{$table_prefix}cash_groups_cash_maxearn]         DEFAULT (0) FOR [cash_maxearn], 
CONSTRAINT [DF_
{$table_prefix}cash_groups_cash_perpm]           DEFAULT (0) FOR [cash_perpm], 
CONSTRAINT [DF_
{$table_prefix}cash_groups_cash_allowance]       DEFAULT (0) FOR [cash_allowance], 
CONSTRAINT [DF_
{$table_prefix}cash_groups_cash_allowanceamount] DEFAULT (0) FOR [cash_allowanceamount], 
CONSTRAINT [DF_
{$table_prefix}cash_groups_cash_allowancetime]   DEFAULT (2) FOR [cash_allowancetime], 
CONSTRAINT [DF_
{$table_prefix}cash_groups_cash_allowancenext]   DEFAULT (0) FOR [cash_allowancenext]"


   "CREATE TABLE [userid].[{$table_prefix}cash_log] (
log_id [int] IDENTITY (1, 1) NOT NULL,
log_time [int] NOT NULL,
log_type [int] NOT NULL,
log_action [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
log_text [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
) ON [PRIMARY]"

   "ALTER TABLE [userid].[{$table_prefix}cash_log] WITH NOCHECK ADD 
CONSTRAINT [PK_
{$table_prefix}cash_log] PRIMARY KEY CLUSTERED 

[log_id] 
) ON [PRIMARY]"

   "ALTER TABLE [userid].[{$table_prefix}cash_log] WITH NOCHECK ADD 
CONSTRAINT [DF_
{$table_prefix}cash_log_log_time]   DEFAULT (0) FOR [log_time], 
CONSTRAINT [DF_
{$table_prefix}cash_log_log_type]   DEFAULT (0) FOR [log_type], 
CONSTRAINT [DF_
{$table_prefix}cash_log_log_action] DEFAULT (' ') FOR [log_action], 
CONSTRAINT [DF_
{$table_prefix}cash_log_log_text]   DEFAULT (' ') FOR [log_text]" 
);
break;
case 'mysql':
case 'mysql4':
default:
$sql = array(
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_disable',0);",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_display_after_posts',1);",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_post_message','You earned %s for that post');",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_disable_spam_num',10);",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_disable_spam_time',24);",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_disable_spam_message','You have exceeded the alloted amount of posts and will not earn anything for your post');",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_installed','yes');",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_version','2.2.2');",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('points_name','Points');",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_adminnavbar','1');",
   "INSERT INTO {$table_prefix}config (config_name, config_value) VALUES ('cash_adminbig','0');",

   "CREATE TABLE {$table_prefix}cash (
cash_id smallint(6) NOT NULL auto_increment,
cash_order smallint(6) NOT NULL default '0',
cash_settings smallint(4) NOT NULL default '3313',
cash_dbfield varchar(64) NOT NULL default 'user_cash',
cash_name varchar(64) NOT NULL default 'cash',
cash_default int(11) NOT NULL default '0',
cash_decimals tinyint(2) NOT NULL default '0',
cash_imageurl varchar(255) NOT NULL default ' ',
cash_exchange int(11) NOT NULL default '1',
cash_perpost int(11) NOT NULL default '25',
cash_postbonus int(11) NOT NULL default '2',
cash_perreply int(11) NOT NULL default '25',
cash_maxearn int(11) NOT NULL default '75',
cash_perpm int(11) NOT NULL default '0',
cash_perchar int(11) NOT NULL default '20',
cash_allowance tinyint(1) NOT NULL default '0',
cash_allowanceamount int(11) NOT NULL default '0',
cash_allowancetime tinyint(2) NOT NULL default '2',
cash_allowancenext int(11) NOT NULL default '0',
cash_forumlist varchar(255) NOT NULL default ' ',
PRIMARY KEY  (cash_id)
);"
,

   "CREATE TABLE {$table_prefix}cash_events (
event_name varchar(32) NOT NULL default ' ',
event_data varchar(255) NOT NULL default ' ',
PRIMARY KEY  (event_name)
);"
,

   "CREATE TABLE {$table_prefix}cash_exchange (
ex_cash_id1 int(11) NOT NULL default '0',
ex_cash_id2 int(11) NOT NULL default '0',
ex_cash_enabled int(1) NOT NULL default '0',
PRIMARY KEY  (ex_cash_id1,ex_cash_id2)
);"
,

   "CREATE TABLE {$table_prefix}cash_groups (
group_id mediumint(6) NOT NULL default '0',
group_type tinyint(2) NOT NULL default '0',
cash_id smallint(6) NOT NULL default '0',
cash_perpost int(11) NOT NULL default '0',
cash_postbonus int(11) NOT NULL default '0',
cash_perreply int(11) NOT NULL default '0',
cash_perchar int(11) NOT NULL default '0',
cash_maxearn int(11) NOT NULL default '0',
cash_perpm int(11) NOT NULL default '0',
cash_allowance tinyint(1) NOT NULL default '0',
cash_allowanceamount int(11) NOT NULL default '0',
cash_allowancetime tinyint(2) NOT NULL default '2',
cash_allowancenext int(11) NOT NULL default '0',
PRIMARY KEY  (group_id,group_type,cash_id)
);"
,

   "CREATE TABLE {$table_prefix}cash_log (
log_id int(11) NOT NULL auto_increment,
log_time int(11) NOT NULL default '0',
log_type smallint(6) NOT NULL default '0',
log_action varchar(255) NOT NULL default ' ',
log_text varchar(255) NOT NULL default ' ',
PRIMARY KEY  (log_id)
);"
);
break;
}

foreach ( 
$sql AS $query 

   if ( !($result $db->sql_query($query)) )
   
      $error $db->sql_error();
      print('<li>' nl2br($query) . '<br /> +++ <font color="#FF0000"><b>Error:</b></font> ' $error['message'] . '</li><br />');
   
   else 
   

      print('<li>' nl2br($query) . '<br /> +++ <font color="#00AA00"><b>Successfull</b></font></li><br />');
   
}

$forum_url append_sid($phpbb_root_path "index.$phpEx");
$phpbb_url "http://www.phpbb.com/phpBB/viewtopic.php?t=94055#623226";

print<<<DELIM
        </ul>
      </span>
    </td>
  </tr>
  <tr>
    <td class="catBottom" height="28">&nbsp;</td>
  </tr>
  <tr>
    <td class="catBottom" colspan="2" align="center">Finished</td>
  </tr>
</table>

<br />
<br />

<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">
  <tr>
    <th class="thHead">SQL Installation complete</th>
  </tr>
  <tr>
    <td>
      <span class="genmed">Please delete this file (sql_install.
{$phpEx}).<br />
      If you have any problems, please visit <a href="
{$phpbb_url}" target="_new">phpbb.com (CashMod v 2.2.2 Support Thread)</a> and ask for help.</span>
    </td>
  </tr>
  <tr>
    <td class="catBottom" height="28" align="center">
      <span class="genmed"><a href="
{$forum_url}">Click Here to return to your forum.</a>
      </span>
    </td>
  </tr>
</table>

DELIM;

include(
$phpbb_root_path 'includes/page_tail.'.$phpEx); 

?>


This is a script for performing the necessary SQL operations to install a MOD for PHP. I need something like this for my database, unless a more weildly otpion presents itself. However, I have no idea what to do to convert the phpBB segments to SMF.

[Unknown]

Quote from: [frost.] on May 12, 2005, 03:49:52 PM
:-[ I'm getting really worried about this problem. My friend has a board with www.xsorbit.com which looks remarkably like SMF (which means it's either YaBB SE or SMF). His paid plan covers a certain amount of pageviews a month, and anything over that they start charging him heavily. With his rapidly-swelling membership, and some jokers running scripts that generate pageviews on his site at a phenomenal rate, he is tired of this and wants to switch. He has over 800 members and 20k+ topics, though, so starting over from scratch is not an option I can get him to accept.

It is an older version of SMF.

QuoteGiven the similarities between the two forums, I decided to import the database from the original to a new forum. This was the only real option I had, and an excellent tutorial for this can be found here on this site.

Did you run upgrade.php?  Seems you didn't; please do so.

Quote
-I cannot import a 22MB SQL file into phpMyAdmin (on my host? Or is this a general rule?)

Sure you can!  Either break it up into smaller files, each sized 2 mb or less, or upload it to the server and use restore_backup.php (attached.)

QuoteI cannot follow your recommended proceedure, and it's taking an inexcusably long time to complete this process - and I'm getting errors on top of that!

Which?  Upgrading?

-[Unknown]

Synaptic Anarchy

I've been trying it in pieces with little to no success...can I upload the compressed version for use with this script?

[Unknown]

Yes.  Just access the script, it has instructions.

-[Unknown]

Synaptic Anarchy

Alright, now...it's a trade-off. I went from having a SMF forum with no working topics to having an XSorbit forum again with the topics working...

http://www.aoyn.net/forums/index.php [nofollow]

Aside from all the ugly little extra characters and messed-up tags, I have a few errors, the XSorbit styles and images, faulty URLs, and some errors when attempting to maintain the board.

Where do I go from here?

Ben_S

Liverpool FC Forum with 14 million+ posts.

Advertisement: