Nov 8, 2009

SMF: Importing A Forum Database For Testing - Do I need to change the prefix?

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Software > Bulletin Board Systems > Simple Machines Forum

SMF: Importing A Forum Database For Testing - Do I need to change the prefix?

WeaponX
Hi, I have a forum with over 1000 members now and want to use that to do my testing. I'm using SMF 1.1 beta 3.

Will it work if I download the full database backup from my other webhost (not astahost) and import it directly into Astahost? I know that it will always append a prefix to the database name. I just want to install a test version of SMF in Astahost and do all my modding there. How can I change all the prefixes to the one I have in Astahost (assuming that it's required)?

Thanks.

Comment/Reply (w/o sign-up)

miCRoSCoPiC^eaRthLinG
Usually when you take a db dump with mysqldump it writes out the database and table structures as well. Now SMF uses just one database with multiple tables - right ? So once you get the dump file, simply remove the CREATE DATABASE smfdb syntax found in the top few lines.

Next install SMF on asta - that'll create the required table structures. Now simply import your dump using phpMyAdmin and that should do the trick. Usually, all CREATE TABLE syntaxes created by mysqldump also includes the DROP & IF EXISTS clauses, which means, if your table is found to exist, it is dropped and a new table is created and populated with data. This won't affect you adversely in any way as your SMF tables will be blank anyways. The above process should create a mirror copy of the mysql tables on your earlier host.

Regards,
m^e

Comment/Reply (w/o sign-up)

WeaponX
Thanks for the reply m^e.

I'm not sure how to use mysqldump from the command line, so I usually get it directly from my SMF Forum backup section. I don't see that though. This is what I have:
QUOTE
# ==========================================================
#
# Database dump of tables in `Edited_Prefix_yabb2`
# August 10, 2005, 11:02:17 AM
#
# ==========================================================


#
# Table structure for table `yabbse_attachments`
#

DROP TABLE IF EXISTS `yabbse_attachments`;

CREATE TABLE `yabbse_attachments` (
  ID_ATTACH int(10) unsigned NOT NULL auto_increment,
  ID_THUMB int(10) unsigned NOT NULL default 0,
  ID_MSG int(10) unsigned NOT NULL default 0,
  ID_MEMBER mediumint(8) unsigned NOT NULL default 0,
  filename tinytext NOT NULL default '',
  size int(10) unsigned NOT NULL default 0,
  downloads mediumint(8) unsigned NOT NULL default 0,
  attachmentType tinyint(3) unsigned NOT NULL default 0,
  width mediumint(8) unsigned NOT NULL default 0,
  height mediumint(8) unsigned NOT NULL default 0,
  PRIMARY KEY (ID_ATTACH),
  UNIQUE ID_MEMBER (ID_MEMBER, ID_ATTACH),
  KEY ID_MSG (ID_MSG)
) TYPE=MyISAM;

#
# Dumping data in `yabbse_attachments`
#

INSERT INTO `yabbse_attachments`

.....etc...
I get that from the top. This keeps going on with other thinks like dumping ban_groups, ban_items, etc. So how do I change the CREATE TABLE? For all of them.

Also, I have to use the same folder/path for my SMF install at Astahost right? Because I see a lot of these entries:
QUOTE
/home/my_account_name/public_html/bb/.....
...just means any other folders listed there (too much for me to list).

I did the full database backup of SMF by checking these:
QUOTE
Save the table structure.
Save the table data. (the important stuff.)
Compress the file with gzip.
I downloaded here at my work computer and it's only 8MB in size. I assume this is because it's compressed. Once I unzipped it, it's 40MB which is the filesize download I get at home. How can I download the 8MB compressed file at home? I don't know why this happens. All my settings are the same and I'm using Firefox at home and work to download this. Still work could get 8MB backup, but at home I could only get the uncompressed version.

 

 

 


Comment/Reply (w/o sign-up)

Houdini
If you have a good editor with search and replace then just do a replace all "DROP TABLE IF EXISTS" instances or even better if you editor allows you to veiw each instance of the found text then you can just take your cursor and remove each one instance and the following text after it

Or when you go to phpMyAdmin make sure when exporting your database as an SQL file that the Add DROP TABLE box is not checked it will create a file without you having to edit anything, if you need a screenshot leave me a PM and I will do that.

Comment/Reply (w/o sign-up)

miCRoSCoPiC^eaRthLinG
See ideally you needn't worry about importing this data directly into your new copy of SMF. If both the versions on your two hosts are identical then table structures will also be 100% same. in that case - the DROP TABLE IF EXISTS followed by CREATE TABLE will just recreate your blank tables and then populate them with the data from your older board.

However problems arise - when you already have a couple of posts in your new board... The new posts will be indexed with say for example 1...2...3...4...etc. whereas the posts in your old board will also start with indexes of 1..2..3..etc . When you try to import this data into the new board - there will be a clash of primary key indexes and phpMyAdmin most likely will refuse to import the data due to Duplicate Primary Keys. I'd advice you to start off with a clean copy of SMF and simply import the old data into it and then carry on with new posts. As I said, it wouldn't matter if your new SMF has already created the tables - as long as both the versions are same.

The paths of the board on either host is irrelevant here - coz the path is not related to your mysql db. As long as SMF knows which database to store it's data in, it's all fine - and that data as far as I remember is stored in a separate config.php file, which wouldn't come in the way of your data importing in any way.

All the best smile.gif

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : smf, importing, forum, database, testing, change, prefix

  1. How Are The Password Hashed In SMF Database?
    (4)
  2. Instructions For Using The SSI Scripts For SMF
    Inserting SMF Modules In Non-Forum Pages (8)
    Recently I received a request for help adding the SMF Ultimate Shout Box Modification on a static
    HTML page. While there are other matbe even better ways to add the shout box from the forum to the
    rest of your website, this is the quickest and easiest. Overview Of The SMF SSI Script: The
    included SSI script for SMF allows several of the forum modules to be displayed on non-forum related
    pages such as static pages and non-SMF generated dynamic pages. This way you could display whatever
    your forum news is on any or all pages on your website with just a few lines of co....
  3. How To Install SMF
    Installing Simple Machines Forum (15)
    This guide will show you how to install an SMF forum in the event that you do not have Fantastico or
    cannot, for some reason, install SMF from it. Step 1: The first step is to make sure you have
    access to a MySQL database and enough rights for it (I don't know exactly what you need but if
    you have full access rights you will obviously be okay.) To create a MySQL database on your host
    through cPanel (comes with all Astahost accounts) login to cPanel by going to yoursite.com/cpanel or
    yoursite.astahost.com/cpanel and entering your username and password. Under site ....
  4. SMF: Simple Machines Forum
    General Descritption And Tutorial Link (1)
    S imple M achines F orum - SMF SMF is a relatively new bulletin board
    script written in PHP and XHTML. Here is a list of features: Advanced User Management Multiple New
    Member Registration Methods Child Forum (sub-forum) Support Multiple User Levels And Permission
    Levels Multiple Templates Easy To Use Control Panel Calendar Built-in Modification Package
    Installer Many Modifications Availible With More Arriving Frequently Support Forum Multiple
    Language Support Very Fast Forum Parsing More Check out their website: http://www.s....

    1. Looking for smf, importing, forum, database, testing, change, prefix

See Also,

*SIMILAR VIDEOS*
Searching Video's for smf, importing, forum, database, testing, change, prefix
advertisement



SMF: Importing A Forum Database For Testing - Do I need to change the prefix?

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com