Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Install newest version and import data from old shop


marketeer2

Recommended Posts

Hi all!

 

I'd like someone to point me in the right direction on this:

 

I have a running version 2.2 MS2 and would like to install version 2.2 RS2a together with some contributions the running version does not have. The new install I would like to test first before I drop the running version. So, I would like to start from scratch and install one after the other, test operation with sample data. But then, I would like to test operations with all of the data I have in the current install.

 

I guess this would mean importing the products, article options, customers, customer orders and what not into the new test version? If all goes well, I would want to just drop the current version and link the new one to the external website.

 

Does it work out that way? And, if yes, what are the intricacies and pitfalls I'd need to prepare for? Any doc guidelines on this?

 

best regards,

marketeer

Link to comment
Share on other sites

hi if you make a SQL file you can then import everything from your old shop to the new one

 

Hi!

 

Could you be a little more specific?

 

The database is a mySQL database. I have access to the database thru PHPadmin and can export.

Link to comment
Share on other sites

You might like to use xampp to create a web server on your local pc and create your new shop there where you can amend it and test it in peace before moving it onto a live site.

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 ======>>>>>.

Link to comment
Share on other sites

If you have experience with mysql databases then it is a piece of cake, otherwise it's not. First go onto your control panel of your website (not the control panel of OSCommerce) and see if your webhost has a program called phpMyAdmin installed. If you do not have this program installed, then, well the rest of my post is worthless.

 

In phpmyAdmin, you should be able to locate both databases, the one connected to the old and the one connected your new oscommerce cart. Make backups of both databases. Then 'export' the old database to your desktop. (make sure you select all the tables - you'll see this option in phpmyAdmin after you click the export tab). Then go to the new database in phpmyadmin. Note that you have more tables in the new database than in the old. Because the new oscommerce program needs all these new tables, you cannot simply replace the new database with the older database that does not have these additional tables.

 

However, you cannot upload data from tables in the old database into the same tables in the new database unless those tables are empty. So,

one by one, using phpmyadmin, 'empty' (that's 'empty', not 'drop') the tables in the new database that correspond to the tables in the old database. You can, and should, leave the data in the new tables alone. Then 'import' the old database from your desktop into the new database, again using phpmyadmin.

 

If there is a better way to it, I would like to be corrected, as I find my method tedious.

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

George

 

Have you thought of simply changing the drop statements to empty and delete the create statements in the backup file?

 

G

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 ======>>>>>.

Link to comment
Share on other sites

George

 

Have you thought of simply changing the drop statements to empty and delete the create statements in the backup file?

 

G

 

@npn

 

Thanks for your description. I tried it exactly according to your description. Subsequently, I tried logging on with admin and received an error message for: mainf function in file application.top line 288 file not found (approx.). Neither could I acces the shop as a user, same error message.

 

@geoffrywalton

As I requested to airbrushmaster above, I would require more specific information.

 

As it seems, many of the people who post in this forum are pretty much expert to the subject matter. And, regretfully, they sometimes assume that others understand their input. Many times, I don't! I'm not the techy, I'm just a marketing dude who is trying to handle this shop system, pretty much of a technical newbie. So if jargon is used, such as: "...delete the create statements in the file...", I'm lost in the bits and bytes. It makes me laugh, actually. And it makes me believe I shouldn't be swimming in these waters in the first place!

 

Catch my drift, y'all! I appreciate anyone's attention to my shop problems. But being such a newcomer to this stuff, I just can't follow some of your suggestions.

 

I do have an idea for a work-around. Maybe you'd like to comment on it:

 

1. I make a complete working copy of the shop. Meaning: on the same webspace, for the same website (i.e., in ./test/catalog...), all of the web files and I create a 'mirror' of the original SQL database (of course with a new name).

 

2. I experiment with the test shop, adding contributions, changing layouts, whatever and thereby find out what works and what doesn't.

 

3. Whatever works out on the test shop, i.e. a contribution, I then implement on the original.

 

So, if the idea is good, how do I implement it? Can I make a replica, an identical copy of the SQL DB?

 

Looking forward to your replies,

BTW, I do regard this as part of a necessary learning process.

 

regs,

marketeer

Link to comment
Share on other sites

hi if you want the same database as your old shop just make a backup in admin then download it and import it as i said but if your not sure how to ask your host to import it for you just make the backup upload to your new shop and tell your host where it is will take them a few secs to do hope this helps

Link to comment
Share on other sites

You probably have completed everything successfully, and have all your old data successfully in your new. However, and I apologize, the sign-on, or the log-on information for your new database is probably mismatched. Look at two files in your new shop (you can 'view' them from your website control panel in 'file manager'): includes/config.php and admin/includes/config.php. Find the sign on data toward the end of the files. Then open up your control panel for your website. Since you seem to have phpMyadmin, look for a program called MysqlDatabases. In that program you can create a new user and password for the new database. Make it the same that is in includes/config.php and admin/includes/config.php.

 

The error you are getting is not an error that implies you done anything fatal. I also would not screw around the application.top that the error refers to. That is not necessarily where the error is, only where the script just stopped proceeding. It will most likely go away once you get signed in.

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

@npn

 

Thanks for your description. I tried it exactly according to your description. Subsequently, I tried logging on with admin and received an error message for: mainf function in file application.top line 288 file not found (approx.). Neither could I acces the shop as a user, same error message.

 

@geoffrywalton

As I requested to airbrushmaster above, I would require more specific information.

 

As it seems, many of the people who post in this forum are pretty much expert to the subject matter. And, regretfully, they sometimes assume that others understand their input. Many times, I don't! I'm not the techy, I'm just a marketing dude who is trying to handle this shop system, pretty much of a technical newbie. So if jargon is used, such as: "...delete the create statements in the file...", I'm lost in the bits and bytes. It makes me laugh, actually. And it makes me believe I shouldn't be swimming in these waters in the first place!

 

Catch my drift, y'all! I appreciate anyone's attention to my shop problems. But being such a newcomer to this stuff, I just can't follow some of your suggestions.

 

I do have an idea for a work-around. Maybe you'd like to comment on it:

 

1. I make a complete working copy of the shop. Meaning: on the same webspace, for the same website (i.e., in ./test/catalog...), all of the web files and I create a 'mirror' of the original SQL database (of course with a new name).

 

2. I experiment with the test shop, adding contributions, changing layouts, whatever and thereby find out what works and what doesn't.

 

3. Whatever works out on the test shop, i.e. a contribution, I then implement on the original.

 

So, if the idea is good, how do I implement it? Can I make a replica, an identical copy of the SQL DB?

 

Looking forward to your replies,

BTW, I do regard this as part of a necessary learning process.

 

regs,

marketeer

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

You probably have completed everything successfully, and have all your old data successfully in your new. However, and I apologize, the sign-on, or the log-on information for your new database is probably mismatched. Look at two files in your new shop (you can 'view' them from your website control panel in 'file manager'): includes/config.php and admin/includes/config.php. Find the sign on data toward the end of the files. Then open up your control panel for your website. Since you seem to have phpMyadmin, look for a program called MysqlDatabases. In that program you can create a new user and password for the new database. Make it the same that is in includes/config.php and admin/includes/config.php.

 

The error you are getting is not an error that implies you done anything fatal. I also would not screw around the application.top that the error refers to. That is not necessarily where the error is, only where the script just stopped proceeding. It will most likely go away once you get signed in.

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

My experience with 'test shops'. I have found have a test shop is a really good idea, and almost always have one or two going. However, I have personally found it less confusing to have my test shop on a completely different website. For me the primary reason is that the two shops are absolutely separated, and it makes it easier to replace the live shop with the completed test shop. This is because of the configuration and the internal linking of the new and old are more similar: there isn't that extra 'catalog/ thing all over the place.

 

And more, with the test shop on a separate site, if you really screw things up during the transfer, (and it isn't hard to do), you have screwed up only one of your two working sites. Also with the two sites separate you can go wild on the test site, confident that you aren't affecting the running site.

 

Better yet, you can, instead of transferring the stuff in the test site to the running site- which can be hard, you can simply transfer your domain of the running site to the test site - that's easy. Your run of the mill tech support guy at your webhost can do that for you in minutes, if you have both sites at the same webhost.

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

Thanks for your input, npn2531!

 

Meantime I have successfully mirrored the live db. I used PHP scripts I received from my webhoster to a) export (dump) the SQL DB and b.) to import the dump.sql file into the empty test DB I had created previously.

 

Yes, I believe having the test shop on a completely different webspace is better, as you described. And I am experiencing this: when I log on to the test shop as admin, the landing page URL states that I am on the test shop. But! When I choose an option, say 'orders', the URL switches to show I'm on the live shop admin console. This is odd, if not to say: suspicious.

 

So, I'm going to delete the shop webfiles from the test directory and the newest shop version on a different webspace. Two questions arise:

1) If I install a new shop, how do I connect it to the test DB?

2) The install docs state that sample entries are made to the DB during installation. Does that overwrite the existing test DB?

 

Looking forward ...

 

marketeer

Link to comment
Share on other sites

Thanks for all your inputs, guys and gals!

 

I think I've got it right and would like to post the activities here, so others with the same quest (see above) will have some pointers:

 

1. created a new, empty SQL database

2. exported the complete data in the live DB to a dump.sql file using a php script:

 

<?php

 

$host= 'dbxx.1und1.de';

$user= 'dbxxxxxx';

$pass= 'xxxxxxxx';

$db= 'dbxxxxxxx';

 

 

system(sprintf(

'mysqldump --opt -h%s -u%s -p"%s" %s | gzip > %s/dumpDB.sql.gz',

$host,

$user,

$pass,

$db,

getenv('DOCUMENT_ROOT')

));

echo '+DONE';

?>

 

3. imported the complete data in the dump.sql file to the new DB with a php script:

 

<?php

 

$host= 'dbhostname';

$user= 'dbusername';

$pass= 'dbpassword';

$db= 'dbname';

 

 

system(sprintf(

'gunzip -c %s/dumpDB.sql.gz | mysql -h %s -u %s -p%s %s',

getenv('DOCUMENT_ROOT'),

$host,

$user,

$pass,

$db

));

echo '+DONE';

?>

 

Note: to apply the php scripts above, I put the code into an MS editor and saved each as a .php file (i.e. import.php and export.php). Then I uploaded them to a 'testcatalog' directory/folder on my webspace. After exporting, the dumpfile holding the DB is put into just that directory. And when importing, the script looks at just that directory to get the file for upload to the new DB. To call the scripts I used a standard browser, i.e. www.mywebsite/testcatalog/import.php.

If the code executes successfully, your browser prints 'DONE'.

 

Results so far: a replica of my live shopDB on a different webspace.

 

4. Copied all of the webfiles of the live shop locally to the local test directory/folder.

 

5. Zipped all of those files (the complete live shop catalog and sub directories)

 

6. Uploaded the zip file to my test webspace and unzipped there.

 

7. Changed the following pointers locally and uploaded them to the webspace:

 

file ./catalog/includes/configure.php

changed the entries (directory names) there to the new webspace directories and to the new test database (dbname, dbhost etc.)

 

file ./catalog/admin/includes/configure.php

made changes as just mentioned

 

8. Created a new .htaccess file for admin access to the store using my webproviders control panel. This can also be done manually, but I didn't want to get into that (to much for me).

 

End results: A replica of my live shop I can use for testing purposes.

 

Disclaimer: This worked for me, I have done Zero testing on other environments, and don't know if it will work for you.

 

regs,

marketeer

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...