3 replies [Last post]
jasuttie's picture
Offline
Joined: 08/25/2011
Juice: 7
Was this information Helpful?

Hi all,

We're trying to work out the best way to sync data to Ubercart from an external MS SQL database. The data will only be one way MS SQL -> Ubercart and we would want it to run nightly to ensure products and stock levels are up to date.

Has anyone done this before and can provide some advice or code? One way we're thinking is to create a script which queries the external MS SQL database creating a csv file then using the Node_import module to update the system. Is there another way people would recommend?

The data import would
- Add any new products
- Update Prices (we're using price per role so there is more than 1 price for each product)
- Update stock level
- Remove items(or make inactive) any obsolete stock.

Any advice would be great or if someone knows how to do this we would consider paying to have it done.

Thanks

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1433
Re: Importing data from MS SQL Database

If you have access to CRON on your server (i.e. most control panels do) then set up a cron job to first copy the database to a secure folder on the server. Then set up a second cron job to email you the database say ten minutes later.

Do this for DB backup purposes and not for the task as you have stated.

See if "drush" will get you closer to your goal.

http://drupal.org/node/670460

jasuttie's picture
Offline
Joined: 08/25/2011
Juice: 7
Re: Re: Importing data from MS SQL Database

Thanks Alaska, however the data structure isn't the same on the MS SQL database, there are just some fields which we need to populate ubercart with.

zeezhao's picture
Offline
Joined: 04/23/2008
Juice: 969
Re: Re: Re: Importing data from MS SQL Database

You certainly need your own script to do this... You can also then use node_import but also take a look at:

http://www.unibia.com/unibianet/drupal/how-import-products-drupal-uberca...

http://drupal.org/project/migrate
http://drupal.org/node/850180

http://drupal.org/project/feeds