Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

restoring a database on new server


Guest

Recommended Posts

Posted

Hi,

 

I am currently in the process of moving my site onto a new server and have run into a problem with the sql database. The problem is that when creating a sql database on my new host's server the database name must start with "cfbsupp_" so have been forced to create a database called "cfbsupp_oscommerce", the thing is my original database (on the old server) is called "cfb_oscommerce". I have tried to change the name of the database in the sql backup file and then restore that on the new server but phpMyAdmin says can’t create database because it already exists. What am I doing wrong?

 

Thanks, David.

Posted

You need to create the database on the new server as cfbsupp_oscommerce and then use phpmyadmin to upload your database into it. You will also need to change your confiugre files so they reference the new database.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted

David

 

Can you post the start of your sql backup file.

 

The error message says db cfbsupp_oscommerce already exists which seems logical as you created it.

 

So something in the backup sql must be tring to create a db.

 

I just dumped my db and got this.

 

-- phpMyAdmin SQL Dump

-- version 2.7.0-pl1

-- http://www.phpmyadmin.net

--

-- Host: localhost

-- Generation Time: Nov 13, 2007 at 08:40 PM

-- Server version: 5.0.18

-- PHP Version: 5.1.1

--

-- Database: `oscommerce`

--

 

-- --------------------------------------------------------

 

--

-- Table structure for table `address_book`

--

 

DROP TABLE IF EXISTS `address_book`;

CREATE TABLE IF NOT EXISTS `address_book` (

`address_book_id` int(11) NOT NULL auto_increment,

`customers_id` int(11) NOT NULL,

`entry_gender` char(1) collate latin1_general_ci NOT NULL,

`entry_company` varchar(32) collate latin1_general_ci default NULL,

`entry_firstname` varchar(32) collate latin1_general_ci NOT NULL,

`entry_lastname` varchar(32) collate latin1_general_ci NOT NULL,

`entry_street_address` varchar(64) collate latin1_general_ci NOT NULL,

`entry_suburb` varchar(32) collate latin1_general_ci default NULL,

`entry_postcode` varchar(10) collate latin1_general_ci NOT NULL,

`entry_city` varchar(32) collate latin1_general_ci NOT NULL,

`entry_state` varchar(32) collate latin1_general_ci default NULL,

`entry_country_id` int(11) NOT NULL default '0',

`entry_zone_id` int(11) NOT NULL default '0',

PRIMARY KEY (`address_book_id`),

KEY `idx_address_book_customers_id` (`customers_id`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=6 ;

 

 

and so on

 

Then using phpmyadmin selected the db, in this case oscommerce, and then sql then pasted the sql in and ran it.

 

No problem, but hey aint that always the way. Your sql must have something in there that wants to create the db that already exists. Drop that line and try again.

 

Jack is right remember to edit both of the config fils to point to the new db and set the pw.

 

Enjoy

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...