Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Moving a entire script


Capsuna

Recommended Posts

Hello

 

I want to move a osCommerce sript, from a server who have cPanel to another. I have a large data base with a lot of products and i do not want to loose any information.

 

How can i move without losing info?

 

The new server have cPanel. Don't tell me about back-up and restore via cPanel beacuse in this case the data base will get emty.

 

It is another option?

 

Miquel

Link to comment
Share on other sites

Hello

 

I want to move a osCommerce sript, from a server who have cPanel to another. I have a large data base with a lot of products and i do not want to loose any information.

 

How can i move without losing info?

 

The new server have cPanel. Don't tell me about back-up and restore via cPanel beacuse in this case the data base will get emty.

 

It is another option?

 

Miquel

Actually it is pretty easy

 

1. Back up your osC database in your osC admin.

2. FTP your complete store to your local computer and then to new server.

3. Create database and user at new server

4. Populate new database in phpmyadmin using backup sql file from last backup found in admin/backups folder.

5. Change settings in your two configure.php files to match new server

6. You need to change permissions on on few files and folders depending on what contributions you have installed but at the mimimun your /images folder and your /admin/backups folder need to be set at 777.

 

You should be good to go.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

Hello

 

i have made like you told me but i got this erorr:

 

1046 - No Database Selected

 

select configuration_key as cfgKey, configuration_value as cfgValue from configuration

 

[TEP STOP]

 

 

What is going on??

 

I have selected a data base. The catalog works fine in user area.

 

But in admin area get me that erorr.

 

Best reagrds

 

Miquel

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

Hi

 

I'm also moving my shop to another location, and i did teh things told in this topic. But when try to go to my store it says:

 

Warning: main(includes/functions/database.php): failed to open stream: No such file or directory in /home/posliini/public_html/includes/application_top.php on line 62

 

Fatal error: main(): Failed opening required 'includes/functions/database.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/posliini/public_html/includes/application_top.php on line 62

 

Whats wrong, it says about the database, but admin folder is working fine. And the admins gonfigure.php has the same database info. But my admin section is telling that it could'n write in images folder, is that it why it wont work ?

 

And how can i change rights in images folder. I'm using SMARTFTP and it cannot modify folders rights.

 

Thanks.

Link to comment
Share on other sites

The process does work. These are the steps I take but you need to keep a few things in mind.

 

Lets assume your account user name for your domain is "general" for the following examples

 

For the database you have to include the complete database and user names so if you name your database "store" and your user "admin , your congfigure.php file should look like this.

 

// define our database connection

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

define('DB_SERVER_USERNAME', 'general_store');

define('DB_SERVER_PASSWORD', '123456');

define('DB_DATABASE', 'general_admin');

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

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

 

Notice that the username and database include your account user name.

 

Also in addition to changing the url's in you includes/configure.php file you need to make sure you change the following line so that it matches your new information ( again using your hosting account user name ).

 

define('DIR_FS_CATALOG', '/home/general/public_html/');

 

 

 

You will see this a few times in your admin/includes/configure.php file

 

define('DIR_FS_DOCUMENT_ROOT', '/home/general/public_html/'); // where the pages are located on the server

 

define('DIR_FS_ADMIN', '/home/general/public_html/admin/'); // absolute pate required

 

define('DIR_FS_CATALOG', '/home/general/public_html/'); // absolute path required

 

 

 

define('DIR_FS_CATALOG', '/home/general/public_html/');

 

You need to make sure they are all correct or everything will not work correctly.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

  • 1 month later...

How do you do step 4.

 

4. Populate new database in phpmyadmin using backup sql file from last backup found in admin/backups folder.

 

Is the backup a SQL statement that needs to be run? I don't see a restore in PHPAdmin.

 

Thanks,

 

Zych

Link to comment
Share on other sites

How do you do step 4.

 

4. Populate new database in phpmyadmin using backup sql file from last backup found in admin/backups folder.

 

Is the backup a SQL statement that needs to be run?  I don't see a restore in PHPAdmin.

 

Thanks,

 

Zych

 

Yes the backup is a sql file. Go to phpmyadmin, select your database and then click on the sql tab, click on browse and drill down to the backup file and click go.

 

This will populate your database with all the info.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

Yes the backup is a sql file. Go to phpmyadmin, select your database and then click on the sql tab, click on browse and drill down to the backup file and click go.

 

This will populate your database with all the info.

 

Worked like a charm. Thank you!

Link to comment
Share on other sites

How do you do step 4.

 

4. Populate new database in phpmyadmin using backup sql file from last backup found in admin/backups folder.

 

Is the backup a SQL statement that needs to be run?  I don't see a restore in PHPAdmin.

 

Thanks,

 

Zych

 

specifically, it depends on the procedure that generated the backup file: if you created the backup either throgh oscommerce or through cPanel, both use mysqldump utility. i dare to guess that anyone else does too....

 

in this case (ie, the backup file generated by mysqldump), you should do the following:

1) if the file is zipped, unzip it.

2) run (that is unix/linux. not sure about windoz):

 

mysql --user=<user_name> --host=<host_name> --password=<password> DATABASE_NAME <  sql_backup_file

 

if you can run the command from the new host, the "--host=" part can be ommited.

if you run the command from a different host, you may want to add the "-C" command line option.

the database must exist, and the user (in the "--user= " part) must have full privileges.

the mysql will automatically modify the "user" to "user@host", where the "host" is where you run the command. (note: the "--host=" part of the command line is where the mysqlserver is running) make sure the privileges belong either to 'user'@'host' where 'host' is where you run the command, or to 'user'@'%' (i.e., any host)

 

i just read my post, and it is not the clearest possible.... maybe some gentle soul can either point to my errors, or in case there are none, repeat it in a clearer phrasing...

 

 

hope it helps,

arod.

Link to comment
Share on other sites

  • 1 month later...

I have done everything that is said above and i get a very weird result.

It now gives me the categories on the left and whats new box in german(we are english) and the rest is blank apart from the very top with the shop logo.

have a look www.northdevoncomputers.com/shop

If anyone can help it would be much appreciated as i am losing money every minute this is down.

 

Nick

Link to comment
Share on other sites

I have done everything that is said above and i get a very weird result.

It now gives me the categories on the left and whats new box in german(we are english) and the rest is blank apart from the very top with the shop logo.

have a look www.northdevoncomputers.com/shop

If anyone can help it would be much appreciated as i am losing money every minute this is down.

 

Nick

 

I tried to take a look and nothing but error messages. One thing to keep in mind, all your php files need to be ftp in ASCII format and not binary.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

I tried to take a look and nothing but error messages.  One thing to keep in mind, all your php files need to be ftp in ASCII format and not binary.

 

Just putting it back to how it was so you can take a look, i am making sure that they get uploaded in ASCII as well.

Link to comment
Share on other sites

Looks like i have fixed it, the way the includes/configure.php was written was different from one server to another even after doing the changes above.

I now have another little problem in that when i am in admin it keeps saying Error: Catalog images directory does not exist: /home/sites/northdevoncomputers.com/public_html/shop/images/

 

How can i get rid of this.

Link to comment
Share on other sites

Looks like i have fixed it, the way the includes/configure.php was written was different from one server to another even after doing the changes above.

I now have another little problem in that when i am in admin it keeps saying Error: Catalog images directory does not exist: /home/sites/northdevoncomputers.com/public_html/shop/images/

 

How can i get rid of this.

 

Make sure the permissions on your images directory are 777.

 

Make sure the actual location matches what is showing in your admin and configure.php file

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

Yes that is exactly what it was richard. I have three configure.php files due to some contributions and it was the one in admin/includes/configure.php that needed addressing

 

Thanks all for your help

 

Nick

Link to comment
Share on other sites

Actually it is pretty easy

 

1. Back up your osC database in your osC admin.

2. FTP your complete store to your local computer and then to new server.(WHEN I GO TO MY FTP IT DOESNT HAVE ANY OF MY FILES THERE, ANYONE KNOW HOW TO GET THE ENTIRE STORE IN THE FTP FOLDER???)

3. Create database and user at new server

4. Populate new database in phpmyadmin using backup sql file from last backup found in admin/backups folder.

5. Change settings in your two configure.php files to match new server

6. You need to change permissions on on few files and folders depending on what contributions you have installed but at the mimimun your /images folder and your /admin/backups folder need to be set at 777.

 

You should be good to go.

 

WHEN I GO TO MY FTP IT DOESNT HAVE ANY OF MY FILES THERE, ANYONE KNOW HOW TO GET THE ENTIRE STORE IN THE FTP FOLDER???)

Link to comment
Share on other sites

I have followed all the steps and most things are working ok. My problem is none of the modules are showing in the admin screen for paymen, shipping or total. I have tried all the suggestions for chmod and it has not worked. Is there some configuration, that I need to apply to the apache server as I am changing from a linux environment to win2000?

 

Thanks

Tom

Link to comment
Share on other sites

This thread should be stuck or something. First thread I found about moving your site. Really good work guys!!!

 

One word about phpmyadmin, You need to create the db (and populate it), then create the user and THEN apply the user to the db.

 

Step 4 is also easy to mess up. It prolly will look something like "adminID_DBuser"

 

 

-Cybin

Link to comment
Share on other sites

  • 1 month later...
Hello

 

i have made like you told me but i got this erorr:

 

1046 - No Database Selected

 

select configuration_key as cfgKey, configuration_value as cfgValue from configuration

 

[TEP STOP]

What is going on??

 

I have selected a data base. The catalog works fine in user area.

 

But in admin area get me that erorr.

 

Best reagrds

 

Miquel

 

Thank you all so much for this information! I had to switch hosting and this information was invaluable.

 

I followed the instructions exactly and I got this same error message that I have quoted above. Somewhere else I read that you have to assign the user to the database afterwards - many thanks to the person who posted that information - I had searched through so many different threads tonight but I couldn't find it again afterwards to properly acknowledge you.

 

So, I went to MySQL in cpanel and re-assigned the user (which I created earlier) to the database. Everything's now working!

 

Sydney

Link to comment
Share on other sites

  • 4 months later...

This is a great post, but I have a follow-on question or two. What about the SSL certificate and the payment gateway? Will those transfer automatically when I copy the site across, or do I need to contact those companies before making the switch?

 

What's the best way to do the switch? Do you copy everything over, process a test transaction, run the site through its paces, and then switch the nameserver on the domain once everything checks out? Can I even do that?

 

What about data integrity issues? How do you ensure that nothing changes in your db as you do the switch? Do you do it early in the morning and disable your site from when you do the db backup until you make the switch?

 

Anyway, looking for some sagely advise before I screw things up.

 

Thanks,

Ken

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...