1
Big_Bro
Site move to a mySQL DB with a different name, is it possible?
  • 2004/7/2 1:24

  • Big_Bro

  • Just popping in

  • Posts: 52

  • Since: 2003/2/26


I am moving my site to a new webhost (Surpass) and could use some advice regarding the database name. Surpass unfortunately adds a prefix to any DB name one creates, thus making it impossible for me to use my current production database name on the new server.

I'd like to be able to copy all of my files over, create and then drop the DB tables, make my permissions and path changes and be done with it. How would I go about using a different DB name on an existing site, what would need to be changed? Or better yet, how would one best approach this kind of a site move?

2
Chris03
Re: Site move to a mySQL DB with a different name, is it possible?
  • 2004/7/2 1:30

  • Chris03

  • Quite a regular

  • Posts: 372

  • Since: 2004/2/22


Do mySQL export from phpmyadmin and replace all table prefixes with the one they give you, and then import the SQL dump using phpmyadmin again and all should work, make sure you change it in mainfile.php!


EXAMPLE:

CREATE TABLE `xoops_configcategory` (
`confcat_id` smallint(5) unsigned NOT NULL auto_increment,
`confcat_name` varchar(25) NOT NULL default '',
`confcat_order` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`confcat_id`)
) TYPE=MyISAM AUTO_INCREMENT=7 ;

#
# Dumping data for table `xoops_configcategory`
#

INSERT INTO `xoops_configcategory` VALUES (1, '_MD_AM_GENERAL', 0);
INSERT INTO `xoops_configcategory` VALUES (2, '_MD_AM_USERSETTINGS', 0);
INSERT INTO `xoops_configcategory` VALUES (3, '_MD_AM_METAFOOTER', 0);
INSERT INTO `xoops_configcategory` VALUES (4, '_MD_AM_CENSOR', 0);
INSERT INTO `xoops_configcategory` VALUES (5, '_MD_AM_SEARCH', 0);
INSERT INTO `xoops_configcategory` VALUES (6, '_MD_AM_MAILER', 0);

REPLACE XOOPS_ with what they want!!

3
tl
Re: Site move to a mySQL DB with a different name, is it possible?
  • 2004/7/2 1:31

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


Please check WIKI

FAQMoving

4
Big_Bro
Re: Site move to a mySQL DB with a different name, is it possible?
  • 2004/7/2 1:50

  • Big_Bro

  • Just popping in

  • Posts: 52

  • Since: 2003/2/26


Thanks very much for the replies. I looked for that info on the wiki yesterday having seen it there before but couldn't access it at all for some reason yesterday, works better now though.

I am under a bit of a time constraint as my current host is demanding a years upfront fees for my dedicated server ($600) and since I refuse those terms I want to get my site up and installed elsewhere before they cut me off completely, which will likely be within a day or so.

I am familiar with backing up and restoring a DB under normal circumstances, but how would I specify the new DB table prefix in the file name template field? That always confused me a bit, if my old db name is ABCD and my new db name is USERNAME_ABCD, what would I enter?

As to the other export settings in the structure and data checkboxes, I can't remember what worked succesfully for me last time. I would normally just play around with it until something worked but I am pressured for time and can't take a chance at losing my DB, for it will cost me dearly to retrieve it from this host. Can someone help me fill in the blanks?

5
Chris03
Re: Site move to a mySQL DB with a different name, is it possible?
  • 2004/7/2 2:00

  • Chris03

  • Quite a regular

  • Posts: 372

  • Since: 2004/2/22


ok open the SQL dump with notepad do replace ABCD_ with USERNAME_ABCD_ replace all and save it make sure that you make a copy of the original one before you edit it!
change mainfile.php to USERNAME_ABCD for the prefix

6
Big_Bro
Re: Site move to a mySQL DB with a different name, is it possible?
  • 2004/7/2 2:14

  • Big_Bro

  • Just popping in

  • Posts: 52

  • Since: 2003/2/26


Thanks Chris, just saw that edit but I'm unsure how exactly to apply it, I have used sqltalk plenty before for running scripts at work and such but I still really don't understand sql completely and it's general usage and am confused as to where to start with that.

Someone at the hosts forums suggested I simply change the following line in the mainfile:

// Database Name
// The name of database on the host. The installer will attempt to create the database if not exist
define('XOOPS_DB_NAME', 'NEW_DB_NAME');

Could it really be that easy?

7
Chris03
Re: Site move to a mySQL DB with a different name, is it possible?
  • 2004/7/2 2:16

  • Chris03

  • Quite a regular

  • Posts: 372

  • Since: 2004/2/22


I actually tried that and i got nothing....just a blank page

8
Big_Bro
Re: Site move to a mySQL DB with a different name, is it possible?
  • 2004/7/2 2:19

  • Big_Bro

  • Just popping in

  • Posts: 52

  • Since: 2003/2/26


Just saw your second post Chris, that makes sense to me. I thought the mainfile change was too good to be true, guess that was the case ;)

I will give it a shot and report the results! Thanks

9
Chris03
Re: Site move to a mySQL DB with a different name, is it possible?
  • 2004/7/2 2:19

  • Chris03

  • Quite a regular

  • Posts: 372

  • Since: 2004/2/22


i PM'd you big_bro

Login

Who's Online

197 user(s) are online (137 user(s) are browsing Support Forums)


Members: 0


Guests: 197


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits