move a table from MySQL to another MySQL
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- move a table from MySQL to another MySQL
move a table from MySQL to another MySQL
04-02-2013 12:01 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I have installed a smf as a community website using the curve template. I successfully ran a few plugins on the site (smf 2.0.2 version) then there was a call to upgrade to version 2.0.3. I installed that taking a backup as you do. Problem was some of the plugins had dug themselves deep in to the style sheet and the MySQL data base. One of the plugins was SimpleAds!!
I've been trying to transfer the members names, messages etc., to a new MySQL data base using a fresh install of smf . I really don't want to risking losing the member names or their messages. I've got two test site ready for a transfer but I need to know how to transfer a table from one to another.
Any advice?
Re: move a table from MySQL to another MySQL
04-02-2013 2:33 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
If you need to overwrite existing tables in the new database you can do this by ticking the Add DROP TABLE checkbox before doing the export (you can do this in any case, it doesn't matter whether the table initially exists or not). You might find it helpful to use a filename template such as __DB__smf_%Y-%m-%d for the export file; the % tokens will be replaced by yyyy-mm-dd.
Re: move a table from MySQL to another MySQL
04-02-2013 12:39 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Gabe
Re: move a table from MySQL to another MySQL
04-02-2013 5:20 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Thanks for your fast reply.
I managed to move the member list from database dir01 to dir02 and that worked fine. However, it had no structure so I tried doing the same with categories and got the following error:
Quote Unknown column 'c.id_cat' in 'field list'
File: /home/xxxxxxxxx/public_html/dir02/Sources/Subs-BoardIndex.php
Line: 72
Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.4, while your database is at version 2.0.3. The above error might possibly go away if you execute the latest version of upgrade.php.
I had upgraded both sites to 2.0.4 before trying to move the members and there wasn't an error so I don't think the data base version that's causing the error. One thing that might have caused it was the first time I tried to move categories it wouldn't have it so I dropped that table then imported the new file:
Unknown column 'c.id_cat' in 'field list'
If so how would I go about putting in id for column
'c.id_cat' in 'field list' ?
Re: move a table from MySQL to another MySQL
05-02-2013 1:05 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I assume the test sites (effectively) have all the mods removed from files. If you copy all the database tables across are any extra tables introduced by the mods simply ignored so that the forum works normally? Alternatively if you didn't copy tables that aren't in the standard distribution over (ie assume any additional tables are mod-related) does the test forum still work?
Re: move a table from MySQL to another MySQL
05-02-2013 3:59 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Strange thing is that I was using the curve theme when I did the upgrade from smf 2.0.2 to 2.0.3 which broke my forum, I was able to get into the admin area and use the old 'core' theme, this worked even with the mods although I had removed the SimpleAds plug in or at least I thought I had! I'll try putting back the original 'c.id_cat' in 'field list id' that I had dropped using the original old categories 'id' then go through the process again.
As mentioned the live site is working using the core theme just showing a few errors that only the admin can see, the test board 01 is working the same as the on-line live site, but test board 02 throws up the error I put on my previous post. I can still get in to the admin area on all boards but there is no structure / categories to the test board 02.
Thank you for your help so far, I have at least managed to move my members names over to the new board. I'll let you know if putting in the categories old 'id', works.
Re: move a table from MySQL to another MySQL
05-02-2013 4:41 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
SELECT userid, username, a.id_cat AS id_cat FROM table1 AS a, table3 AS c WHERE a.id_cat = c.id_cat;
Are your tables too large to make looking at their contents impractical?
A brief look at the SimpleAds plugin shows there is a database.sql file for modifying the SMF database, but an equivalent file to remove the modifications has not been provided.

Re: move a table from MySQL to another MySQL
06-02-2013 3:54 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
However, when I try to change the theme to Curve from Core I get this error:
Quote Fatal error: Call to undefined function PublicIndextop() in /home/xxxxxxx/public_html/dir01/Sources/Load.php(2151) : eval()'d code on line 314
I prefer to use the Curve theme because I'm trying to keep the site up to date in every way. I'm assuming that an edit of the 'Sources/Load.php(2151)' file may do the trick if only I knew what I was looking for and how to remove/replace the php code that is causing the error.
I don't think my tables are that large. The sites only been running seven months now and has sixty odd members.
I've been looking at the posts on the smf site and there are a lot of people trying to sort out the problems that the SimpleAds plugin has caused. The original coder sold the site a few years ago and the new owner is now charging people $15 to $50 to adapt the code from one theme to another. I'd rather go without using the plugin, not because I object to his charging but I have no confidence in his work judging from peoples comments.
Do you know how I would go about fixing the fatal error in the load.php file?
Thanks for all your help todate spraxyt.
Re: move a table from MySQL to another MySQL
06-02-2013 4:33 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
You may need a fresh reload of that theme.
Gabe
Re: move a table from MySQL to another MySQL
06-02-2013 7:54 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I think the Curve theme might be the one in the default folder. The SimpleAds manual installation instructions mention making changes to default, but I didn't spot any reference to PublicIndextop in these instructions. Perhaps it occurs in one of the additional SimpleAds files - are any of those still in the ./Themes/default folders?
Perhaps Core isn't affected because the mods were never applied to it? Reloading a clean default theme as suggested by Gabe might fix this.

Re: move a table from MySQL to another MySQL
07-02-2013 4:56 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
It seemed to be a problem with the Curve theme, I did as you both suggested and installed a fresh Curve theme making sure that the database I used was clean of any mods. Then went to themes settings and used the Reset Theme URLs and Directories.
All is working as it should.
Without your help I'd still be struggling.

Re: move a table from MySQL to another MySQL
07-02-2013 5:14 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator

Gabe
Re: move a table from MySQL to another MySQL
07-02-2013 7:04 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- move a table from MySQL to another MySQL