Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help moving database


amateur

Recommended Posts

To cut a long story short our last web designer did a runner and left us in the lurch. We had just set up on a new web host before he left. I just noticed today that the database is still on the old server and he has it linked to oscommerce on the new server.

 

 

Any way I did a backup through the control panel of osc , downloaded a copy . I don't have access to the old server so I can see where to put it on the new one. Also I would be greatful if some one could point out what I should edit in the configure.php file .

I have an idea but don't want to f*** this up. At the moment osc runds from mydomain.com/catalog/

 

// define our database connection

define('DB_SERVER', 'xxxx.xxxx.com'); // eg, localhost - should not be empty for productive servers

define('DB_SERVER_USERNAME', 'blabla');

define('DB_SERVER_PASSWORD', 'blabla');

define('DB_DATABASE', 'xxxx_xxxx');

define('USE_PCONNECT', 'false'); // use persistent connections?

define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

?>

 

 

Thanks for any help with this one.

Link to comment
Share on other sites

To cut a long story short our last web designer did a runner and left us in the lurch. We had just set up on a new web host before he left. I just noticed today that the database is still on the old server and he has it linked to oscommerce on the new server.

Any way I did a backup through the control panel of osc , downloaded a copy . I don't have access to the old server so I can see where to put it on the new one. Also I would be greatful if some one could point out what I should edit in the configure.php file .

I have an idea but don't want to f*** this up.  At the moment osc runds from mydomain.com/catalog/

 

// define our database connection

  define('DB_SERVER', 'xxxx.xxxx.com'); // eg, localhost - should not be empty for productive servers

  define('DB_SERVER_USERNAME', 'blabla');

  define('DB_SERVER_PASSWORD', 'blabla');

  define('DB_DATABASE', 'xxxx_xxxx');

  define('USE_PCONNECT', 'false'); // use persistent connections?

  define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

?>

Thanks for any help with this one.

 

The configur files need edited...

 

define('DB_SERVER', 'xxxx.xxxx.com'); should read..

define('DB_SERVER', 'localhost');

 

you need to edit 2 configure.php files...

 

includes/configure.php

admin/includes/configure.php

 

And the database name will be the database name that you set up on the new server....On the new server in your cpanel you need to setup a new database..

 

Mike

Link to comment
Share on other sites

assuming MySQL.

 

a sysadmin should create a fresh database on the new server, with a set of user/password with full privileges.

 

i can give you a short description of how its done. i assume MySQL on linux. it may or may not work the same way on different db/os combo.

 

log in as root.

at the prompt type "mysql"

 

choose database name, user name, and password. i will use DBNAME, USER and PASSWORD. replace with your choice. there is no relation with user name or password on the host. these are purely for MySQL. invent fresh name and pw.

 

at the mysql prompt, type

create database DBNAME;

 

dont forget the semicolon!

you should get something like

Query OK, 1 row affected (0.07 sec)

 

now type

grant all on DBNAME.* to 'USERNAME'@'HOST' identified by 'PASSWORD';

 

the "ticks" (single quotes) as well as the semicolon are important.

the 'HOST' part is the name of the host running the apache web server. if it is the same host that runs the MySQL, usually 'localhost' will do. beware: if you omit the @'HOST' part, the database will be accessible from anywhere with those user name/password, and your security is reduced.

 

finally, to verify everything went fine, type:

show grants for 'USERNAME'@'HOST';

.

 

you should see something like:

+-----------------------------------------------------------------------------------+
| Grants for USERNAME@HOST                                                          |
+-----------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'USERNAME'@'HOST' IDENTIFIED BY PASSWORD '4051fa79125fece7' |
| GRANT ALL PRIVILEGES ON `DBNAME`.* TO 'USERNAME'@'HOST'                           |
+-----------------------------------------------------------------------------------+

 

quit mysql (the command line utility) by typing quit,

 

now feed the username and password into configure.php (attention! there are 2 of them, one for the catalog, and one for the admin part. dont ask me why).

 

you are likely to screw up once or twice. if you do that, choose a different database name,

type

drop database DBNAME;
create database DBNAME2;

and repeat the process for the new database name.

 

of course, i assumed you manage the host yourself, and you have root access.

otherwise, ask the chap who manage it to create a new database, and grant usage to USERNAME on host HOST, using PASSWORD.

 

good luck! (i'm afraid you'll need it).

 

 

arod.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...